/*
 * ================================================================
 *  CodeTech SMS Platform
 * ---------------------------------------------------------------
 *  Author      : CodeTech
 *  Telegram    : @codetech9
 *  E-mail      : codetech888@gmail.com
 * ================================================================
 */
:root {
    --navy-950: #060d1a;
    --navy-900: #0b1628;
    --navy-800: #112040;
    --navy-700: #1a3260;
    --blue-600: #2563eb;
    --blue-500: #2563c8;
    --blue-400: #3b7de8;
    --blue-300: #6fa3f0;
    --blue-100: #c8dcfa;
    --blue-50:  #e8f0fd;
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --white: #ffffff;
    --green-500: #22c55e;
    --green-50:  #f0fdf4;
    --red-500:   #ef4444;
    --red-50:    #fef2f2;
    --red-700:   #b91c1c;
    --amber-500: #f59e0b;
    --font: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
    font-family: var(--font);
    background: var(--navy-950);
    color: var(--slate-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}


.auth-bg {
    position: fixed; inset: 0; z-index: 0;
    background: linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 40%, var(--navy-800) 100%);
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 15% 50%, rgba(59,130,246,0.08), transparent),
        radial-gradient(ellipse 500px 350px at 85% 30%, rgba(6,182,212,0.06), transparent),
        radial-gradient(ellipse 400px 300px at 50% 80%, rgba(139,92,246,0.04), transparent);
    pointer-events: none;
}
.auth-bg::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}


.auth-wrapper {
    position: relative; z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}


.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 36px;
}
.auth-logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 24px rgba(59,130,246,0.3);
}
.auth-logo-icon i { font-size: 20px; color: var(--white); }
.auth-logo-text {
    font-size: 22px; font-weight: 500; color: var(--white);
    letter-spacing: -0.5px;
}


.auth-card {
    width: 100%;
    max-width: 440px;
}
.auth-card-inner {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.06);
}

.auth-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--slate-800);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--slate-500);
    margin-bottom: 28px;
}


.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-label .required {
    color: var(--red-500);
    margin-left: 2px;
}
.input-wrap {
    position: relative;
}
.input-wrap i.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: var(--slate-400);
    pointer-events: none;
    transition: color 0.2s;
}
.input-wrap .input-field:focus ~ i.input-icon,
.input-wrap:focus-within i.input-icon {
    color: var(--blue-500);
}
.input-field {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 14px;
    color: var(--slate-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.input-field::placeholder { color: var(--slate-400); }
.input-field:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(59,125,232,0.1);
}
.input-field.input-error {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}


.input-toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    font-size: 15px; color: var(--slate-400);
    padding: 4px;
    transition: color 0.2s;
}
.input-toggle-pw:hover { color: var(--slate-600); }


.captcha-row {
    display: flex; gap: 10px; align-items: stretch;
}
.captcha-row .input-wrap { flex: 1; }
.captcha-img {
    height: 46px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--slate-200);
    flex-shrink: 0;
}


.cf-turnstile {
    display: flex;
    justify-content: center;
}
.cf-turnstile iframe { border-radius: var(--radius-md) !important; }


.btn-auth {
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-auth i { font-size: 14px; }

.btn-primary {
    background: var(--navy-900);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(6,13,26,0.25);
}
.btn-primary:hover {
    background: var(--navy-700);
    box-shadow: 0 4px 20px rgba(6,13,26,0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: 0.6; cursor: not-allowed; transform: none;
}


.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.alert i { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.alert-error {
    background: var(--red-50);
    color: var(--red-700);
    border: 1px solid rgba(239,68,68,0.15);
}
.alert-success {
    background: var(--green-50);
    color: #15803d;
    border: 1px solid rgba(34,197,94,0.15);
}


.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--slate-500);
}
.auth-footer a {
    color: var(--blue-500);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.auth-footer a:hover { color: var(--blue-400); }

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.auth-links a {
    font-size: 13px;
    color: var(--blue-500);
    text-decoration: none;
    transition: color 0.2s;
}
.auth-links a:hover { color: var(--blue-400); }


.auth-divider {
    display: flex; align-items: center; gap: 16px;
    margin: 24px 0;
    font-size: 12px; color: var(--slate-400);
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--slate-200);
}


.auth-page-footer {
    position: relative; z-index: 1;
    text-align: center;
    padding: 20px;
}
.auth-page-footer span {
    font-size: 12px;
    color: rgba(255,255,255,0.2);
}


.pw-strength {
    display: flex; gap: 4px; margin-top: 8px;
}
.pw-strength-bar {
    flex: 1; height: 3px; border-radius: 2px;
    background: var(--slate-200);
    transition: background 0.3s;
}
.pw-strength[data-level="1"] .pw-strength-bar:nth-child(1) { background: var(--red-500); }
.pw-strength[data-level="2"] .pw-strength-bar:nth-child(-n+2) { background: var(--amber-500); }
.pw-strength[data-level="3"] .pw-strength-bar:nth-child(-n+3) { background: var(--blue-500); }
.pw-strength[data-level="4"] .pw-strength-bar { background: var(--green-500); }
.pw-strength-text {
    font-size: 11px; color: var(--slate-400); margin-top: 4px;
}


.form-agree {
    margin-bottom: 20px;
}
.agree-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--slate-600);
    line-height: 1.5;
    -webkit-user-select: none;
    user-select: none;
}
.agree-checkbox {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}
.agree-check {
    width: 18px; height: 18px;
    min-width: 18px;
    border: 1.5px solid var(--slate-300);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
    transition: all 0.2s;
    background: var(--white);
}
.agree-check i {
    font-size: 10px;
    color: var(--white);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s;
}
.agree-checkbox:checked ~ .agree-check {
    background: var(--blue-600);
    border-color: var(--blue-600);
}
.agree-checkbox:checked ~ .agree-check i {
    opacity: 1;
    transform: scale(1);
}
.agree-checkbox:focus-visible ~ .agree-check {
    box-shadow: 0 0 0 3px rgba(59,125,232,0.15);
}
.agree-text a {
    color: var(--blue-500);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.agree-text a:hover {
    color: var(--blue-400);
    text-decoration: underline;
}


.extra-fields-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 4px;
}
.extra-fields-line {
    flex: 1;
    height: 1px;
    background: var(--slate-200);
}
.extra-fields-btn {
    background: none;
    border: 1px solid var(--slate-200);
    border-radius: 20px;
    padding: 6px 16px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--slate-500);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.extra-fields-btn:hover {
    border-color: var(--blue-400);
    color: var(--blue-500);
    background: var(--blue-50);
}
.extra-fields-btn i {
    font-size: 11px;
    transition: transform 0.3s;
}
.extra-fields-btn.is-open i {
    transform: rotate(45deg);
}
.extra-fields-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
}
.extra-fields-panel.is-open {
    max-height: 600px;
    opacity: 1;
}


.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}


.auth-success-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--green-50);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.auth-success-icon i { font-size: 28px; color: var(--green-500); }


@media (max-width: 480px) {
    .auth-card-inner {
        padding: 28px 22px;
        border-radius: 12px;
    }
    .auth-title { font-size: 20px; }
    .form-input { font-size: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .auth-logo { margin-bottom: 28px; }
    .auth-logo-icon { width: 36px; height: 36px; }
    .auth-logo-icon i { font-size: 17px; }
    .auth-logo-text { font-size: 19px; }
}
