/* public/assets/css/auth.css */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Prompt:wght@400;600;700&display=swap');

/* ── Variables ─────────────────────────────────────── */
/* Palette sampled directly from logo_login.png (navy B + gold C) */
:root {
    --primary:       #123268;
    --primary-dark:  #001F4C;
    --primary-light: #EEF2FA;
    --gold:          #c9a15c;
    --gold-light:    #f0d998;
    --gold-dark:     #9c7a3c;
    --accent:        #06B6D4;
    --success:       #10B981;
    --error:         #EF4444;
    --text-dark:     #0F172A;
    --text-mid:      #475569;
    --text-light:    #94A3B8;
    --border:        #E2E8F0;
    --bg:            #F8FAFC;
    --white:         #FFFFFF;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:     0 4px 24px rgba(15,23,42,.10);
    --shadow-lg:     0 20px 60px rgba(15,23,42,.14);
    --radius:        14px;
    --radius-sm:     8px;
    --transition:    .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Sarabun', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* ── Wrapper ────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Left Panel ─────────────────────────────────────── */
.auth-panel--left {
    position: relative;
    flex: 0 0 42%;
    background:
        repeating-linear-gradient(0deg,  rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 32px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 32px),
        linear-gradient(160deg, #061431 0%, var(--primary-dark) 45%, #1c3a72 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    overflow: hidden;
    color: #fff;
}

/* decorative circles — gold tinted to echo the logo ring */
.auth-panel--left::before,
.auth-panel--left::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(201,161,92,.09);
}
.auth-panel--left::before {
    width: 480px; height: 480px;
    bottom: -180px; right: -180px;
}
.auth-panel--left::after {
    width: 260px; height: 260px;
    top: -70px; left: -70px;
    background: rgba(201,161,92,.06);
}

.panel-deco {
    position: absolute;
    width: 220px; height: 220px;
    top: 50%; right: -70px;
    transform: translateY(-50%) rotate(30deg);
    border: 2px solid rgba(201,161,92,.18);
    border-radius: 30px;
}

/* Brand */
.brand {
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.brand-logo-img {
    display: block;
    width: 320px;
    max-width: 100%;
    margin: 0 0 .5rem;
    filter: drop-shadow(0 10px 24px rgba(0,0,0,.35));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    position: relative;
    z-index: 1;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeUp .5s ease both;
}
.feature:nth-child(1) { animation-delay: .1s; }
.feature:nth-child(2) { animation-delay: .2s; }
.feature:nth-child(3) { animation-delay: .3s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.feature__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(201,161,92,.22), rgba(201,161,92,.08));
    border: 1px solid rgba(201,161,92,.3);
}

.feature strong {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .15rem;
    color: var(--gold-light);
}

.feature p {
    font-size: .85rem;
    opacity: .75;
    line-height: 1.4;
}

/* ── Right Panel ─────────────────────────────────────── */
.auth-panel--right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: var(--white);
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 420px;
    animation: slideIn .4s cubic-bezier(.4,0,.2,1) both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Header */
.form-header {
    margin-bottom: 2rem;
}

.form-header h2 {
    font-family: 'Prompt', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -.5px;
    position: relative;
    padding-left: .85rem;
}

.form-header h2::before {
    content: '';
    position: absolute;
    left: 0; top: .15em;
    width: 4px; height: .8em;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
}

.form-header p {
    color: var(--text-mid);
    font-size: .95rem;
    margin-top: .4rem;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 1.4rem;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.alert--error {
    background: #FEF2F2;
    color: var(--error);
    border: 1px solid #FECACA;
}

.alert--success {
    background: #F0FDF4;
    color: var(--success);
    border: 1px solid #BBF7D0;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: .5rem;
}

.forgot-link {
    font-size: .8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 400;
    transition: color var(--transition);
}
.forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .9rem;
    display: flex;
    align-items: center;
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition);
}
.input-icon svg { width: 18px; height: 18px; }

.form-input {
    width: 100%;
    padding: .8rem 1rem .8rem 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Sarabun', sans-serif;
    font-size: .95rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input::placeholder { color: var(--text-light); }

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18,50,104,.12);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon { color: var(--primary); }

/* Error state */
.form-input.is-invalid { border-color: var(--error); }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

/* Toggle password */
.toggle-password {
    position: absolute;
    right: .8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    padding: .25rem;
    border-radius: 4px;
    transition: color var(--transition);
}
.toggle-password:hover { color: var(--text-mid); }
.toggle-password svg { width: 18px; height: 18px; }

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width .4s ease, background .4s ease;
}

.strength-label {
    font-size: .75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* Match message */
.match-msg {
    font-size: .8rem;
    font-weight: 500;
    margin-top: .35rem;
    display: block;
}
.match-msg.ok    { color: var(--success); }
.match-msg.error { color: var(--error); }

/* Remember */
.form-remember { margin-bottom: 1.5rem; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-size: .875rem;
    color: var(--text-mid);
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
    width: 18px; height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all var(--transition);
    position: relative;
    background: var(--white);
}

.checkbox-label input:checked ~ .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px; left: 5px;
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Submit Button — gold, echoing the checkmark in the logo */
.btn-submit {
    width: 100%;
    padding: .9rem;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(156,122,60,.35);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,rgba(255,255,255,.35) 0%,transparent 60%);
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(156,122,60,.45);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* Spin animation for loader */
@keyframes spin {
    to { stroke-dashoffset: -60; }
}
.spin {
    stroke-dasharray: 60;
    stroke-dashoffset: 0;
    animation: spin .8s linear infinite;
}
.btn-loader svg { width: 20px; height: 20px; }

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .9rem;
    color: var(--text-mid);
}

.form-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: .3rem;
    transition: color var(--transition);
}
.form-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-panel--left { display: none; }
    .auth-panel--right { padding: 2rem 1.25rem; }
    .form-container { max-width: 100%; }
}

@media (max-width: 1024px) {
    .auth-panel--left { flex: 0 0 38%; padding: 2rem 2.5rem; }
}