:root {
    --auth-bg-card:        rgba(7, 10, 14, 0.97);
    --success-text:        #70cca0;
    --success:             #4caf82;
    --success-bg:          rgba(76, 175, 130, 0.10);
}

:root[data-theme="light"] {
    --auth-bg-card:        rgba(255, 253, 250, 0.99);
    --success:             #1e7e4a;
    --success-bg:          rgba(30, 126, 74, 0.08);
    --success-text:        #1e7e4a;
}

[data-theme="light"] .strength-bar {
    background: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .form-message.error {
    color: var(--error);
}


/* ── LAYOUT ── */

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}


/* ── CARD ── */

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 36px;
    background: var(--auth-bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(244, 123, 32, 0.05);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--orange) 50%, transparent 90%);
    opacity: 0.65;
}


/* ── BRAND ── */

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-brand img {
    height: 160px;
    width: auto;
    object-fit: contain;
}


/* ── HEADER ── */

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-warm);
    text-shadow: 0 0 28px rgba(244, 123, 32, 0.2);
    margin-bottom: 7px;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-subtle);
    line-height: 1.45;
}


/* ── FORM ── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.forgot-link {
    font-size: 12px;
    color: var(--orange);
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.forgot-link:hover { opacity: 1; }


/* ── INPUT ── */

.input-wrapper {
    position: relative;
}

.input-wrapper .form-input {
    padding-right: 44px;
}


/* ── TOGGLE PASSWORD ── */

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s ease;
    border-radius: 4px;
}

.toggle-password:hover { color: var(--text-main); }

.toggle-password svg {
    width: 18px;
    height: 18px;
    display: block;
}


/* ── PASSWORD STRENGTH ── */

.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.strength-bars {
    display: flex;
    gap: 5px;
    flex: 1;
}

.strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.strength-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 46px;
    text-align: right;
    transition: color 0.3s ease;
}

.password-strength[data-strength="weak"]   .strength-bar:nth-child(1)    { background: var(--error); }
.password-strength[data-strength="medium"] .strength-bar:nth-child(-n+2) { background: #e09c54; }
.password-strength[data-strength="strong"] .strength-bar                 { background: var(--success); }

.password-strength[data-strength="weak"]   .strength-label { color: var(--error); }
.password-strength[data-strength="medium"] .strength-label { color: #e09c54; }
.password-strength[data-strength="strong"] .strength-label { color: var(--success); }


/* ── CHECKBOX ── */

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid var(--border-orange);
    border-radius: 4px;
    background: var(--field-bg);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.check-input:hover:not(:checked) {
    border-color: var(--orange);
    background: rgba(244, 123, 32, 0.08);
}

.check-input:checked {
    background: var(--orange);
    border-color: var(--orange);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5l2.5 2.5L8.5 2' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 10px;
    box-shadow: 0 0 0 2px rgba(244, 123, 32, 0.20);
}

.check-input.invalid {
    outline: 2px solid var(--error);
    outline-offset: 2px;
    border-radius: 4px;
}

.check-input.valid {
    outline: 2px solid var(--success);
    outline-offset: 2px;
    border-radius: 4px;
}

.check-label {
    font-size: 13px;
    color: var(--text-subtle);
    cursor: pointer;
    line-height: 1.45;
}

.check-label .auth-link {
    color: var(--orange);
    opacity: 0.9;
    font-weight: 600;
}

.check-label .auth-link:hover {
    opacity: 1;
    text-decoration: underline;
}


/* ── FORM MESSAGE ── */

.form-message {
    padding: 11px 14px;
    border-radius: var(--radius-small);
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
}

.form-message.error {
    background: var(--error-bg);
    border-color: rgba(224, 84, 84, 0.28);
    color: var(--error);
}

.form-message.success {
    background: var(--success-bg);
    border-color: rgba(76, 175, 130, 0.28);
    color: var(--success-text);
}


/* ── OTP NOTICE ── */

.auth-otp-notice {
    font-size: 12px;
    color: var(--text-subtle);
    line-height: 1.5;
    margin: 0;
    text-align: center;
}


/* ── SUBMIT BUTTON ── */

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff9951, #c85b1d 52%, #8a320c);
    color: #fdf0e4;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(244, 123, 32, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: filter 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.auth-button:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow:
        0 14px 36px rgba(244, 123, 32, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ── SPINNER ── */

@keyframes spin { to { transform: rotate(360deg); } }

.btn-spinner {
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}


/* ── FOOTER ── */

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-subtle);
}

.auth-link {
    color: var(--orange);
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.15s ease;
}

.auth-link:hover {
    opacity: 1;
    text-decoration: underline;
}


/* ── RESET SUCCESS ── */

.reset-success {
    text-align: center;
    padding: 8px 0 16px;
}

.reset-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: rgba(76, 175, 130, 0.1);
    border: 1px solid rgba(76, 175, 130, 0.25);
    color: var(--success);
}

.reset-icon svg {
    width: 24px;
    height: 24px;
}

.reset-success h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--accent-warm);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.reset-success p {
    font-size: 13px;
    color: var(--text-subtle);
    line-height: 1.55;
}

.reset-success strong {
    color: var(--text-main);
    font-weight: 600;
}

.reset-note {
    margin-top: 10px;
    font-size: 12px !important;
    color: var(--text-muted) !important;
}


/* ── RESPONSIVE ── */

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .auth-brand img { height: 100px; }

    .auth-header h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn-spinner                                  { animation: none; opacity: 0.7; }
    .form-input, .auth-button, .toggle-password,
    .strength-bar, .strength-label, .forgot-link,
    .auth-link                                    { transition: none; }
}


/* ── AUTH THEME TOGGLE ── */

.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
}
