* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --slate: #2F3E46;
    --slate-light: #3D4F58;
    --slate-dark: #253238;
    --slate-deeper: #1a272d;
    --slate-abyss: #131e23;
    --rose: #B76E79;
    --rose-light: #d4949d;
    --rose-dim: #b87d86;
    --rose-pale: #e8bcc2;
    --rose-glow: rgba(183, 110, 121, 0.25);
    --rose-glow-strong: rgba(183, 110, 121, 0.5);
    --smoke: #F5F5F5;
    --smoke-dim: rgba(245, 245, 245, 0.65);
    --smoke-faint: rgba(245, 245, 245, 0.06);
    --smoke-border: rgba(245, 245, 245, 0.06);
    --danger: #e05668;
    --success: #6dcf97;
    --warning: #e0b95e;
    --glass: rgba(37, 50, 56, 0.6);
    --glass-border: rgba(245, 245, 245, 0.07);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--slate-abyss);
    color: var(--smoke);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 40px 20px 60px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.skeleton-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, var(--slate-abyss) 0%, var(--slate-dark) 35%, var(--slate) 65%, var(--slate-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.skeleton-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.skeleton-form {
    width: 100%;
    max-width: 420px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skel-box {
    background: rgba(245, 245, 245, 0.04);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.skel-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(245, 245, 245, 0.03), transparent);
    animation: skelShimmer 1.8s ease-in-out infinite;
}

@keyframes skelShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skel-icon { width: 52px; height: 52px; border-radius: 15px; }
.skel-title { width: 120px; height: 28px; border-radius: 8px; }
.skel-subtitle { width: 180px; height: 14px; border-radius: 6px; }
.skel-heading { width: 160px; height: 24px; border-radius: 8px; }
.skel-input { width: 100%; height: 52px; border-radius: 12px; }
.skel-button { width: 100%; height: 48px; border-radius: 12px; margin-top: 8px; }

.app-wrapper {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(160deg, var(--slate-abyss) 0%, var(--slate-dark) 35%, var(--slate) 65%, var(--slate-light) 100%);
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.gl1 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(183, 110, 121, 0.1) 0%, transparent 70%);
    top: -10%;
    right: -8%;
    animation: gDrift1 24s ease-in-out infinite;
}

.gl2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(183, 110, 121, 0.06) 0%, transparent 70%);
    bottom: -15%;
    left: -12%;
    animation: gDrift2 30s ease-in-out infinite;
}

.gl3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(212, 148, 157, 0.06) 0%, transparent 70%);
    top: 45%;
    left: 50%;
    animation: gDrift3 20s ease-in-out infinite;
}

@keyframes gDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 70px) scale(1.1); }
    66% { transform: translate(30px, -40px) scale(0.95); }
}

@keyframes gDrift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(60px, -50px) scale(1.08); }
}

@keyframes gDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 30px) scale(1.15); }
}

.bg-lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.line {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(183, 110, 121, 0.04) 20%, rgba(183, 110, 121, 0.06) 50%, rgba(183, 110, 121, 0.04) 80%, transparent 100%);
    animation: lineGlow 8s ease-in-out infinite;
}

.l1 { left: 10%; animation-delay: 0s; }
.l2 { left: 30%; animation-delay: 1.5s; }
.l3 { left: 50%; animation-delay: 3s; }
.l4 { left: 70%; animation-delay: 4.5s; }
.l5 { left: 90%; animation-delay: 6s; }

@keyframes lineGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--rose-light);
    opacity: 0;
    animation: particleFloat linear infinite;
}

.p1 { left: 15%; animation-duration: 18s; animation-delay: 0s; }
.p2 { left: 28%; animation-duration: 22s; animation-delay: 4s; }
.p3 { left: 42%; animation-duration: 16s; animation-delay: 2s; }
.p4 { left: 58%; animation-duration: 20s; animation-delay: 6s; }
.p5 { left: 72%; animation-duration: 19s; animation-delay: 1s; }
.p6 { left: 85%; animation-duration: 23s; animation-delay: 5s; }
.p7 { left: 35%; animation-duration: 17s; animation-delay: 8s; }
.p8 { left: 65%; animation-duration: 21s; animation-delay: 3s; }

@keyframes particleFloat {
    0% { bottom: -2%; opacity: 0; transform: translateX(0); }
    5% { opacity: 0.3; }
    50% { opacity: 0.15; }
    95% { opacity: 0.3; }
    100% { bottom: 102%; opacity: 0; transform: translateX(30px); }
}

.bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: pageIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(24px);
}

@keyframes pageIn {
    to { opacity: 1; transform: translateY(0); }
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
    animation: logoIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.15s;
    opacity: 0;
    transform: translateY(16px);
}

@keyframes logoIn {
    to { opacity: 1; transform: translateY(0); }
}

.logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--rose), var(--rose-dim));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    box-shadow: 0 4px 20px var(--rose-glow), 0 8px 40px rgba(183, 110, 121, 0.1);
    animation: logoBreath 5s ease-in-out infinite;
}

.logo-mark:hover {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 6px 30px var(--rose-glow-strong), 0 12px 50px rgba(183, 110, 121, 0.2);
}

@keyframes logoBreath {
    0%, 100% { box-shadow: 0 4px 20px var(--rose-glow), 0 8px 40px rgba(183, 110, 121, 0.1); }
    50% { box-shadow: 0 4px 28px var(--rose-glow-strong), 0 8px 48px rgba(183, 110, 121, 0.18); }
}

.logo-mark span {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
    transition: transform 0.3s ease;
}

.logo-mark:hover span { transform: scale(1.05); }

.logo-text {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--smoke);
}

.tagline {
    color: var(--rose-dim);
    font-size: 0.75rem;
    margin-top: 6px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 400;
}

.form-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    animation: formWrapIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes formWrapIn {
    to { opacity: 1; transform: translateY(0); }
}

.form {
    width: 100%;
    padding: 36px 28px 32px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 16px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.06), 0 32px 64px rgba(0,0,0,0.04), inset 0 1px 0 rgba(245,245,245,0.03), 0 0 80px rgba(183,110,121,0.03);
}

.form.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.form-accent-line {
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rose), transparent);
    opacity: 0.4;
    border-radius: 0 0 2px 2px;
}

.form.active .form-accent-line { animation: accentPulse 3s ease-in-out infinite; }
@keyframes accentPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

.form h2 { font-size: 1.35rem; font-weight: 600; color: var(--smoke); letter-spacing: -0.3px; }
.form-sub { color: var(--smoke-dim); font-size: 0.82rem; margin-top: 4px; margin-bottom: 26px; font-weight: 300; }

.input-group { position: relative; margin-bottom: 16px; }
.input-group input {
    width: 100%;
    background: var(--smoke-faint);
    border: 1px solid var(--smoke-border);
    border-radius: 12px;
    padding: 17px 46px 5px 46px;
    font-size: 0.92rem;
    color: var(--smoke);
    outline: none;
    font-family: inherit;
    font-weight: 400;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.35s cubic-bezier(0.16,1,0.3,1), background 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s cubic-bezier(0.16,1,0.3,1), transform 0.2s ease;
}
.input-group input:focus {
    border-color: var(--rose);
    background: rgba(183,110,121,0.04);
    box-shadow: 0 0 0 3px rgba(183,110,121,0.08), 0 4px 20px rgba(183,110,121,0.05);
    transform: translateY(-1px);
}
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(245, 245, 245, 0.06) inset !important;
    -webkit-text-fill-color: var(--smoke) !important;
    border-color: var(--smoke-border);
    transition: background-color 5000s ease-in-out 0s;
}
.input-group label {
    position: absolute; left: 46px; top: 13px;
    color: rgba(245,245,245,0.25); font-size: 0.88rem; font-weight: 400;
    pointer-events: none;
    transition: top 0.3s cubic-bezier(0.16,1,0.3,1), font-size 0.3s cubic-bezier(0.16,1,0.3,1), color 0.3s ease, letter-spacing 0.3s ease;
}
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 4px; font-size: 0.6rem; color: var(--rose-light); letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
}
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: rgba(245,245,245,0.15); display: flex;
    transition: color 0.35s, transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.input-group input:focus ~ .input-icon,
.input-group input:not(:placeholder-shown) ~ .input-icon {
    color: var(--rose); transform: translateY(-50%) scale(1.05);
}
.toggle-pass {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: rgba(245,245,245,0.15); cursor: pointer; display: flex; z-index: 2; padding: 4px;
    transition: color 0.25s, transform 0.25s;
    -webkit-tap-highlight-color: transparent;
}
.toggle-pass:hover, .toggle-pass:active { color: var(--rose-light); transform: translateY(-50%) scale(1.1); }

.caps-warn {
    position: absolute; bottom: -22px; left: 0; display: flex; align-items: center; gap: 5px;
    color: var(--warning); font-size: 0.68rem; font-weight: 400; opacity: 0;
    transform: translateY(-4px); transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
    pointer-events: none; letter-spacing: 0.2px;
}
.caps-warn.visible { opacity: 1; transform: translateY(0); }
.input-group:has(.caps-warn.visible) { margin-bottom: 30px; }

.username-status { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; }
.uname-available { color: var(--success); }
.uname-taken { color: var(--danger); }
.uname-spinner { width: 16px; height: 16px; border: 2px solid rgba(245,245,245,0.1); border-top-color: var(--rose); border-radius: 50%; animation: spin 0.6s linear infinite; }

.email-suggest {
    position: absolute; bottom: -20px; left: 14px; font-size: 0.68rem; color: var(--rose-light);
    cursor: pointer; opacity: 0; transform: translateY(-4px);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
    -webkit-tap-highlight-color: transparent; letter-spacing: 0.2px;
}
.email-suggest.visible { opacity: 1; transform: translateY(0); }
.email-suggest:hover { color: var(--rose); }
.input-group:has(.email-suggest.visible) { margin-bottom: 30px; }

.lockout-bar {
    display: flex; align-items: center; gap: 8px;
    background: rgba(224,86,104,0.06); border: 1px solid rgba(224,86,104,0.12);
    border-radius: 10px; font-size: 0.75rem; color: var(--danger);
    opacity: 0; max-height: 0; overflow: hidden; padding: 0 14px; margin: 0;
    transition: opacity 0.4s, max-height 0.4s cubic-bezier(0.16,1,0.3,1), padding 0.4s, margin-bottom 0.4s;
}
.lockout-bar.visible { opacity: 1; max-height: 60px; padding: 10px 14px; margin-bottom: 16px; }

.remember-row { margin-bottom: 18px; margin-top: 2px; }
.remember-label {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; font-size: 0.82rem; color: var(--smoke-dim); font-weight: 300; transition: color 0.3s;
}
.remember-label:hover { color: var(--smoke); }
.remember-label input { display: none; }
.remember-toggle {
    width: 36px; height: 20px; border-radius: 20px;
    background: rgba(245,245,245,0.08); border: 1px solid rgba(245,245,245,0.1);
    position: relative;
    transition: background 0.35s cubic-bezier(0.16,1,0.3,1), border-color 0.35s, box-shadow 0.35s;
    flex-shrink: 0;
}
.remember-dot {
    width: 14px; height: 14px; border-radius: 50%; background: rgba(245,245,245,0.3);
    position: absolute; top: 2px; left: 2px;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), background 0.35s;
}
.remember-label input:checked ~ .remember-toggle { background: rgba(183,110,121,0.2); border-color: var(--rose); box-shadow: 0 0 12px rgba(183,110,121,0.15); }
.remember-label input:checked ~ .remember-toggle .remember-dot { transform: translateX(16px); background: var(--rose); }

.terms-row { margin-bottom: 18px; }
.terms-label {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; font-size: 0.76rem; color: var(--smoke-dim); font-weight: 300; line-height: 1.5; transition: color 0.3s;
}
.terms-label:hover { color: var(--smoke); }
.terms-label input { display: none; }
.terms-box {
    width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(245,245,245,0.12);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
    transition: border-color 0.35s, background 0.35s, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.terms-box svg { opacity: 0; transform: scale(0.5); transition: opacity 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1); color: white; }
.terms-label input:checked ~ .terms-box { border-color: var(--rose); background: var(--rose); transform: scale(1.05); }
.terms-label input:checked ~ .terms-box svg { opacity: 1; transform: scale(1); }
.terms-row.error .terms-box { border-color: var(--danger); animation: shake 0.55s cubic-bezier(0.36,0.07,0.19,0.97); }

.rules-link { color: var(--rose-light); cursor: pointer; font-weight: 500; transition: color 0.3s; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(212,148,157,0.3); }
.rules-link:hover { color: var(--rose); text-decoration-color: var(--rose); }

.rules-modal {
    position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; padding: 20px;
}
.rules-modal.active { opacity: 1; visibility: visible; }
.rules-backdrop { position: absolute; inset: 0; background: rgba(10,15,18,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.rules-content {
    position: relative; width: 100%; max-width: 400px; max-height: 80vh;
    background: var(--glass); border: 1px solid var(--glass-border);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
    transform: translateY(20px) scale(0.95); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 32px 64px rgba(0,0,0,0.2), 0 0 80px rgba(183,110,121,0.05);
}
.rules-modal.active .rules-content { transform: translateY(0) scale(1); }
.rules-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid rgba(245,245,245,0.04); }
.rules-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--smoke); letter-spacing: -0.3px; }
.rules-close { color: rgba(245,245,245,0.3); cursor: pointer; padding: 4px; transition: color 0.25s, transform 0.25s; display: flex; -webkit-tap-highlight-color: transparent; }
.rules-close:hover { color: var(--rose-light); transform: scale(1.1); }
.rules-body { padding: 16px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.rules-body::-webkit-scrollbar { width: 4px; }
.rules-body::-webkit-scrollbar-track { background: transparent; }
.rules-body::-webkit-scrollbar-thumb { background: rgba(245,245,245,0.08); border-radius: 4px; }
.rules-item { display: flex; gap: 12px; align-items: flex-start; }
.rules-num { width: 22px; height: 22px; border-radius: 50%; background: rgba(183,110,121,0.12); border: 1px solid rgba(183,110,121,0.2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 600; color: var(--rose-light); flex-shrink: 0; margin-top: 1px; }
.rules-item p { font-size: 0.78rem; color: var(--smoke-dim); line-height: 1.55; font-weight: 300; }
.rules-accept-btn {
    margin: 0 24px 20px; padding: 12px 20px;
    background: linear-gradient(135deg, var(--rose), var(--rose-dim));
    border: none; border-radius: 12px; color: white; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(183,110,121,0.2), 0 8px 24px rgba(183,110,121,0.1);
    -webkit-tap-highlight-color: transparent;
}
.rules-accept-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(183,110,121,0.3), 0 12px 32px rgba(183,110,121,0.15); }
.rules-accept-btn:active { transform: translateY(0) scale(0.98); }

.match-indicator { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); display: flex; opacity: 0; transition: opacity 0.3s cubic-bezier(0.16,1,0.3,1); }
.match-indicator.visible { opacity: 1; }
.match-indicator .match-yes { color: var(--success); }
.match-indicator .match-no { color: var(--danger); }

.password-rules {
    display: flex; flex-direction: column; gap: 7px;
    background: rgba(245,245,245,0.02); border: 1px solid rgba(245,245,245,0.04); border-radius: 12px;
    opacity: 0; max-height: 0; overflow: hidden; padding: 0 14px; margin: 0;
    transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1), max-height 0.5s cubic-bezier(0.16,1,0.3,1), margin-top 0.5s cubic-bezier(0.16,1,0.3,1), margin-bottom 0.5s cubic-bezier(0.16,1,0.3,1), padding-top 0.5s cubic-bezier(0.16,1,0.3,1), padding-bottom 0.5s cubic-bezier(0.16,1,0.3,1);
}
.password-rules.visible { opacity: 1; max-height: 200px; margin-top: 4px; margin-bottom: 14px; padding: 12px 14px; }
.rule { display: flex; align-items: center; gap: 9px; font-size: 0.72rem; color: rgba(245,245,245,0.25); transition: color 0.4s cubic-bezier(0.16,1,0.3,1); letter-spacing: 0.2px; }
.rule.passed { color: var(--success); }
.rule-icon { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid rgba(245,245,245,0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color 0.4s cubic-bezier(0.16,1,0.3,1), background 0.4s cubic-bezier(0.16,1,0.3,1), transform 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.rule.passed .rule-icon { border-color: var(--success); background: rgba(109,207,151,0.12); transform: scale(1.1); }
.rule-check { opacity: 0; transform: scale(0.5); transition: opacity 0.3s cubic-bezier(0.16,1,0.3,1), transform 0.3s cubic-bezier(0.34,1.56,0.64,1); color: var(--success); }
.rule.passed .rule-check { opacity: 1; transform: scale(1); }

.password-strength { width: 100%; height: 3px; background: rgba(245,245,245,0.04); border-radius: 3px; overflow: hidden; opacity: 0; max-height: 0; margin: 0; transition: opacity 0.4s cubic-bezier(0.16,1,0.3,1), max-height 0.4s cubic-bezier(0.16,1,0.3,1), margin-bottom 0.4s cubic-bezier(0.16,1,0.3,1); }
.password-strength.visible { opacity: 1; max-height: 10px; margin-bottom: 5px; }
.strength-fill { height: 100%; width: 0%; border-radius: 3px; transition: all 0.5s cubic-bezier(0.16,1,0.3,1); }
.strength-text { font-size: 0.68rem; color: var(--smoke-dim); display: block; height: 0; overflow: hidden; margin: 0; transition: color 0.3s, height 0.4s cubic-bezier(0.16,1,0.3,1), margin-bottom 0.4s cubic-bezier(0.16,1,0.3,1); font-weight: 400; letter-spacing: 0.3px; }
.strength-text.visible { height: 13px; margin-bottom: 12px; }

.btn {
    width: 100%; padding: 14px 24px;
    background: linear-gradient(135deg, var(--rose), var(--rose-dim)); background-size: 200% 200%;
    border: none; border-radius: 12px; color: white; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; position: relative; overflow: hidden; font-family: inherit; letter-spacing: 0.2px;
    margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px;
    animation: btnBg 6s ease infinite;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    box-shadow: 0 2px 8px rgba(183,110,121,0.2), 0 8px 24px rgba(183,110,121,0.1);
}
@keyframes btnBg { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent); animation: shimmer 4.5s ease-in-out infinite; }
@keyframes shimmer { 0% { left: -100%; } 35%, 100% { left: 100%; } }
.btn-arrow { transition: transform 0.35s cubic-bezier(0.16,1,0.3,1); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(183,110,121,0.3), 0 12px 36px rgba(183,110,121,0.15); }
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn:active { transform: translateY(0) scale(0.985); transition-duration: 0.1s; }
.btn.loading { pointer-events: none; opacity: 0.8; }
.btn.loading span, .btn.loading .btn-arrow { opacity: 0; transition: opacity 0.2s; }
.btn.loading::after { content: ''; position: absolute; width: 20px; height: 20px; border: 2px solid transparent; border-top-color: white; border-right-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.disabled { pointer-events: none; opacity: 0.4; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { display: flex; align-items: center; margin: 20px 0 16px; gap: 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--smoke-border), transparent); }
.divider span { color: rgba(245,245,245,0.15); font-size: 0.72rem; font-weight: 400; text-transform: uppercase; letter-spacing: 2px; }

.switch-text { text-align: center; color: var(--smoke-dim); font-size: 0.82rem; font-weight: 300; }
.switch-link { color: var(--rose-light); cursor: pointer; font-weight: 500; position: relative; transition: color 0.3s; -webkit-tap-highlight-color: transparent; }
.switch-link:hover { color: var(--rose); }
.switch-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--rose); transition: width 0.45s cubic-bezier(0.16,1,0.3,1); }
.switch-link:hover::after { width: 100%; }

.footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; padding-bottom: 16px; animation: footerIn 1.4s cubic-bezier(0.16,1,0.3,1) forwards; animation-delay: 0.5s; opacity: 0; }
@keyframes footerIn { to { opacity: 1; } }
.footer-lock { color: rgba(245,245,245,0.12); display: flex; }
.footer p { color: rgba(245,245,245,0.12); font-size: 0.68rem; letter-spacing: 0.6px; font-weight: 300; }

.success-screen { position: fixed; inset: 0; background: linear-gradient(160deg, var(--slate-abyss) 0%, var(--slate-dark) 50%, var(--slate) 100%); display: flex; align-items: center; justify-content: center; z-index: 9998; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0.5s ease; }
.success-screen.active { opacity: 1; visibility: visible; }
.success-content { text-align: center; }
.success-screen.active .success-content { animation: successBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes successBounce { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.success-check { width: 80px; height: 80px; margin: 0 auto 24px; }
.success-check svg { width: 80px; height: 80px; }
.success-circle { stroke: var(--rose); stroke-width: 2; stroke-dasharray: 157; stroke-dashoffset: 157; animation: circleIn 0.6s cubic-bezier(0.65,0,0.35,1) 0.2s forwards; filter: drop-shadow(0 0 12px var(--rose-glow)); }
@keyframes circleIn { to { stroke-dashoffset: 0; } }
.success-tick { stroke: var(--rose); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: tickIn 0.4s cubic-bezier(0.65,0,0.35,1) 0.6s forwards; }
@keyframes tickIn { to { stroke-dashoffset: 0; } }
.success-title { font-size: 1.6rem; font-weight: 600; color: var(--smoke); margin-bottom: 8px; letter-spacing: -0.5px; opacity: 0; animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.8s forwards; }
.success-sub { color: var(--smoke-dim); font-size: 0.88rem; font-weight: 300; opacity: 0; animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) 1s forwards; }
.success-last { color: var(--rose-dim); font-size: 0.75rem; font-weight: 300; margin-top: 12px; opacity: 0; animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) 1.2s forwards; letter-spacing: 0.3px; }
.success-bar-wrap { width: 200px; height: 3px; background: rgba(245,245,245,0.06); border-radius: 3px; margin: 20px auto 0; overflow: hidden; opacity: 0; animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) 1.4s forwards; }
.success-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--rose), var(--rose-light)); border-radius: 3px; transition: width 0.1s linear; box-shadow: 0 0 8px var(--rose-glow); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-fade { position: fixed; inset: 0; background: var(--slate-abyss); z-index: 99999; opacity: 0; pointer-events: none; transition: opacity 0.8s ease; }
.page-fade.active { opacity: 1; pointer-events: all; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px) scale(0.95); padding: 12px 20px; border-radius: 12px; font-size: 0.82rem; font-weight: 500; opacity: 0; transition: all 0.55s cubic-bezier(0.16,1,0.3,1); z-index: 10000; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); max-width: 88vw; font-family: inherit; box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.toast.success { background: rgba(37,50,56,0.92); border: 1px solid rgba(109,207,151,0.25); color: var(--success); }
.toast.error { background: rgba(37,50,56,0.92); border: 1px solid rgba(224,86,104,0.25); color: var(--danger); }
.toast.warning { background: rgba(37,50,56,0.92); border: 1px solid rgba(224,185,94,0.25); color: var(--warning); }
.toast-icon { font-size: 0.9rem; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-8px); } 30% { transform: translateX(8px); } 45% { transform: translateX(-5px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
.shake { animation: shake 0.55s cubic-bezier(0.36,0.07,0.19,0.97); }
.input-group.error input { border-color: var(--danger); background: rgba(224,86,104,0.04); box-shadow: 0 0 0 3px rgba(224,86,104,0.08); }
.input-group.error label { color: var(--danger) !important; }
.input-group.error .input-icon { color: var(--danger) !important; }
.input-group.valid input { border-color: var(--success); box-shadow: 0 0 0 3px rgba(109,207,151,0.06); }
.input-group.valid .input-icon { color: var(--success) !important; }

.input-stagger { opacity: 0; transform: translateY(10px); transition: opacity 0.45s cubic-bezier(0.16,1,0.3,1), transform 0.45s cubic-bezier(0.16,1,0.3,1); }
.input-stagger.show { opacity: 1; transform: translateY(0); }

@media (max-width: 480px) {
    body { padding: 24px 16px 40px; }
    .logo-section { margin-bottom: 24px; }
    .logo-mark { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 10px; }
    .logo-mark span { font-size: 1.3rem; }
    .logo-text { font-size: 1.65rem; }
    .tagline { font-size: 0.66rem; letter-spacing: 2px; margin-top: 4px; }
    .form { padding: 24px 20px 22px; border-radius: 18px; }
    .form-accent-line { left: 20px; right: 20px; }
    .form h2 { font-size: 1.2rem; }
    .form-sub { font-size: 0.76rem; margin-bottom: 18px; margin-top: 3px; }
    .input-group { margin-bottom: 12px; }
    .input-group input { padding: 15px 42px 4px 42px; font-size: 0.86rem; border-radius: 11px; }
    .input-group label { left: 42px; top: 12px; font-size: 0.82rem; }
    .input-icon { left: 12px; }
    .input-icon svg { width: 16px; height: 16px; }
    .toggle-pass { right: 12px; }
    .toggle-pass svg { width: 16px; height: 16px; }
    .password-rules { gap: 5px; }
    .password-rules.visible { padding: 9px 11px; margin-bottom: 10px; margin-top: 2px; }
    .rule { font-size: 0.66rem; gap: 7px; }
    .rule-icon { width: 14px; height: 14px; }
    .rule-check { width: 11px !important; height: 11px !important; }
    .btn { padding: 12px 20px; font-size: 0.86rem; border-radius: 11px; }
    .divider { margin: 14px 0 12px; }
    .divider span { font-size: 0.66rem; }
    .switch-text { font-size: 0.76rem; }
    .footer { margin-top: 16px; }
    .footer p { font-size: 0.62rem; }
    .toast { bottom: 16px; padding: 10px 16px; font-size: 0.76rem; border-radius: 11px; }
    .remember-row { margin-bottom: 14px; margin-top: 0; }
    .remember-label { font-size: 0.76rem; }
    .terms-row { margin-bottom: 14px; }
    .terms-label { font-size: 0.7rem; }
    .terms-box { width: 16px; height: 16px; }
    .terms-box svg { width: 10px; height: 10px; }
    .lockout-bar { font-size: 0.7rem; }
    .lockout-bar.visible { padding: 8px 12px; margin-bottom: 12px; }
    .success-check { width: 60px; height: 60px; }
    .success-check svg { width: 60px; height: 60px; }
    .success-title { font-size: 1.35rem; }
    .success-sub { font-size: 0.82rem; }
    .success-last { font-size: 0.7rem; }
    .rules-content { border-radius: 18px; max-height: 85vh; }
    .rules-header { padding: 16px 20px 14px; }
    .rules-header h3 { font-size: 1rem; }
    .rules-body { padding: 14px 20px 16px; gap: 12px; }
    .rules-num { width: 20px; height: 20px; font-size: 0.6rem; }
    .rules-item p { font-size: 0.72rem; }
    .rules-accept-btn { margin: 0 20px 16px; padding: 11px 18px; font-size: 0.78rem; }
}

@media (max-width: 360px) {
    body { padding: 18px 12px 28px; }
    .logo-section { margin-bottom: 20px; }
    .logo-mark { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 8px; }
    .logo-mark span { font-size: 1.15rem; }
    .logo-text { font-size: 1.5rem; }
    .form { padding: 22px 16px 20px; border-radius: 16px; }
    .form h2 { font-size: 1.15rem; }
    .form-sub { font-size: 0.72rem; margin-bottom: 16px; }
    .input-group { margin-bottom: 10px; }
    .input-group input { padding: 14px 38px 4px 38px; font-size: 0.84rem; }
    .input-group label { left: 38px; font-size: 0.8rem; }
    .input-icon { left: 10px; }
    .btn { padding: 11px 18px; font-size: 0.84rem; }
    .divider { margin: 12px 0 10px; }
    .remember-row { margin-bottom: 12px; }
    .terms-row { margin-bottom: 12px; }
}

@media (max-height: 700px) and (max-width: 480px) {
    body { padding-top: 12px; }
    .logo-section { margin-bottom: 18px; }
    .logo-mark { width: 38px; height: 38px; margin-bottom: 8px; }
    .logo-mark span { font-size: 1.1rem; }
    .logo-text { font-size: 1.45rem; }
    .tagline { font-size: 0.62rem; margin-top: 3px; }
    .form h2 { font-size: 1.1rem; }
    .form-sub { margin-bottom: 14px; }
    .input-group { margin-bottom: 10px; }
    .input-group input { padding: 13px 38px 4px 38px; }
    .footer { margin-top: 14px; }
}

@media (min-width: 768px) {
    body { padding: 0 20px; align-items: flex-start; min-height: 100vh; overflow-y: auto; }
    .app-wrapper { align-items: flex-start; min-height: unset; }
    .container { max-width: 460px; }
    .logo-section { margin-bottom: 40px; }
    .logo-mark { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 18px; }
    .logo-mark span { font-size: 1.7rem; }
    .logo-text { font-size: 2.2rem; }
    .tagline { font-size: 0.82rem; margin-top: 8px; letter-spacing: 3px; }
    .form { padding: 44px 36px 40px; border-radius: 22px; }
    .form-accent-line { left: 36px; right: 36px; }
    .form h2 { font-size: 1.55rem; }
    .form-sub { font-size: 0.88rem; margin-bottom: 32px; }
    .input-group { margin-bottom: 20px; }
    .input-group input { padding: 20px 50px 7px 50px; font-size: 0.98rem; border-radius: 14px; }
    .input-group label { left: 50px; top: 15px; font-size: 0.92rem; }
    .input-group input:focus ~ label, .input-group input:not(:placeholder-shown) ~ label { top: 5px; font-size: 0.65rem; }
    .input-icon { left: 16px; }
    .input-icon svg { width: 19px; height: 19px; }
    .toggle-pass { right: 16px; }
    .toggle-pass svg { width: 19px; height: 19px; }
    .password-rules.visible { padding: 14px 16px; gap: 9px; }
    .rule { font-size: 0.76rem; }
    .rule-icon { width: 19px; height: 19px; }
    .btn { padding: 16px 28px; font-size: 0.95rem; border-radius: 14px; margin-top: 6px; }
    .divider { margin: 24px 0 20px; }
    .divider span { font-size: 0.76rem; }
    .switch-text { font-size: 0.88rem; }
    .footer { margin-top: 28px; }
    .footer p { font-size: 0.72rem; }
    .toast { bottom: 36px; padding: 14px 24px; font-size: 0.86rem; border-radius: 14px; }
}

@media (min-width: 1200px) {
    .container { max-width: 480px; }
    .form { padding: 48px 40px 44px; }
    .form-accent-line { left: 40px; right: 40px; }
    .logo-mark { width: 64px; height: 64px; }
    .logo-mark span { font-size: 1.8rem; }
    .logo-text { font-size: 2.3rem; }
}