/* Sign-Up Page - Extends login.css AIG design system */

/* ===========================
   RESET & BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   AIG COLOR SYSTEM - DARK THEME (DEFAULT)
   =========================== */
:root {
    --aig-bg-primary: #1a1a1a;
    --aig-bg-secondary: #252525;
    --aig-bg-tertiary: #2f2f2f;
    --aig-bg-elevated: #383838;
    --aig-accent-primary: #6366F1;
    --aig-accent-secondary: #818CF8;
    --aig-accent-tertiary: #3B82F6;
    --aig-text-primary: #FFFFFF;
    --aig-text-secondary: #EBEBF5;
    --aig-text-tertiary: #EBEBF599;
    --aig-text-quaternary: #EBEBF54D;
    --aig-success: #30D158;
    --aig-error: #FF453A;
    --aig-warning: #FFD60A;
    --aig-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --aig-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.05);
    --aig-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.08);
    --aig-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 2px rgba(255, 255, 255, 0.1);
    --aig-glass-bg: rgba(28, 28, 30, 0.72);
    --aig-glass-border: rgba(255, 255, 255, 0.08);
    --aig-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
    --aig-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --aig-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===========================
   LIGHT THEME
   =========================== */
body[data-theme="light"] {
    --aig-bg-primary: #F5F5F7;
    --aig-bg-secondary: #FFFFFF;
    --aig-bg-tertiary: #FAFAFA;
    --aig-bg-elevated: #FFFFFF;
    --aig-accent-primary: #5E5CE6;
    --aig-accent-secondary: #7D7AFF;
    --aig-accent-tertiary: #4C4CDB;
    --aig-text-primary: #1D1D1F;
    --aig-text-secondary: #1D1D1F;
    --aig-text-tertiary: #86868B;
    --aig-text-quaternary: #C7C7CC;
    --aig-success: #28CD41;
    --aig-warning: #FFB340;
    --aig-error: #FF3B30;
    --aig-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --aig-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
    --aig-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
    --aig-shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.1);
    --aig-glass-bg: rgba(255, 255, 255, 0.85);
    --aig-glass-border: rgba(0, 0, 0, 0.08);
}

/* ===========================
   BODY & BACKGROUND
   =========================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--aig-bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   CARD & LAYOUT (mirrors login.css)
   =========================== */
.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
}

.login-card {
    background: var(--aig-glass-bg);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border-radius: 28px;
    padding: 48px 44px;
    box-shadow: var(--aig-shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    border: 1px solid var(--aig-glass-border);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5) 50%, transparent);
    opacity: 0.6;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--aig-accent-primary) 0%, var(--aig-accent-secondary) 50%, var(--aig-accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-header p {
    color: var(--aig-text-tertiary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ===========================
   FORM FIELDS
   =========================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.form-field-half {
    flex: 1;
    min-width: 0;
}

.form-field label {
    color: var(--aig-text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding-left: 4px;
}

.form-field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--aig-text-primary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--aig-ease-out);
    outline: none;
}

.form-field input::placeholder {
    color: var(--aig-text-quaternary);
}

.form-field input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-field input:focus {
    border-color: var(--aig-accent-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 2px 8px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(1.01);
}

/* ===========================
   PASSWORD STRENGTH
   =========================== */
.password-strength {
    display: none;
    height: 4px;
    border-radius: 2px;
    transition: all 0.3s var(--aig-ease-out);
    margin-top: -4px;
}

.password-strength.strength-weak {
    background: var(--aig-error);
    width: 33%;
}

.password-strength.strength-medium {
    background: var(--aig-warning);
    width: 66%;
}

.password-strength.strength-strong {
    background: var(--aig-success);
    width: 100%;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-login {
    margin-top: 8px;
    padding: 16px 28px;
    border: none;
    border-radius: 16px;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    background: linear-gradient(135deg, var(--aig-accent-primary) 0%, var(--aig-accent-secondary) 100%);
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--aig-spring);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s var(--aig-ease-out);
}

.btn-login:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.45), 0 0 60px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===========================
   ERROR MESSAGE
   =========================== */
.error-message {
    margin-top: 4px;
    padding: 14px 18px;
    background: rgba(255, 69, 58, 0.12);
    border: 1.5px solid rgba(255, 69, 58, 0.3);
    border-radius: 12px;
    color: var(--aig-error);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: -0.01em;
    animation: errorShake 0.4s var(--aig-spring);
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===========================
   OAUTH
   =========================== */
.oauth-divider {
    text-align: center;
    margin: 24px 0 20px 0;
    position: relative;
}

.oauth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12) 20%, rgba(255, 255, 255, 0.12) 80%, transparent);
}

.oauth-divider span {
    background: var(--aig-glass-bg);
    backdrop-filter: blur(20px);
    padding: 0 16px;
    position: relative;
    color: var(--aig-text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 24px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    color: var(--aig-text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--aig-ease-out);
    position: relative;
    overflow: hidden;
}

.btn-oauth::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(129, 140, 248, 0.05));
    opacity: 0;
    transition: opacity 0.3s var(--aig-ease-out);
}

.btn-oauth:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-oauth:hover::after { opacity: 1; }
.btn-oauth:active { transform: translateY(0) scale(0.98); }
.btn-oauth svg { flex-shrink: 0; z-index: 1; }

.btn-apple { border-color: rgba(255, 255, 255, 0.15); }
.btn-apple:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-microsoft { border-color: rgba(0, 120, 212, 0.2); }
.btn-microsoft:hover {
    background: rgba(0, 120, 212, 0.08);
    border-color: rgba(0, 120, 212, 0.35);
}

/* ===========================
   BACK LINK
   =========================== */
.back-link {
    color: var(--aig-accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--aig-spring);
    display: inline-block;
}

.back-link:hover {
    color: var(--aig-accent-secondary);
    transform: translateY(-1px);
}

/* ===========================
   LIGHT THEME OVERRIDES
   =========================== */
body[data-theme="light"] .login-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .login-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06) 50%, transparent);
}

body[data-theme="light"] .form-field input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .form-field input:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.18);
}

body[data-theme="light"] .form-field input:focus {
    background: rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .btn-oauth {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .btn-oauth:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .btn-login {
    color: #FFFFFF;
}

/* ===========================
   TE STYLE
   =========================== */
body[data-style="te"] {
    --aig-bg-primary: #000000;
    --aig-accent-primary: #FF6600;
    --aig-accent-secondary: #FF8533;
    --aig-accent-tertiary: #E55C00;
    --aig-glass-bg: #0a0a0a;
    --aig-glass-border: #333333;
    --aig-shadow-xl: none;
    font-family: "Space Mono", "SF Mono", "Roboto Mono", monospace;
}

body[data-style="te"][data-theme="light"] {
    --aig-bg-primary: #F5F5F5;
    --aig-accent-primary: #FF6600;
    --aig-accent-secondary: #E55C00;
    --aig-accent-tertiary: #CC4D00;
    --aig-glass-bg: #FFFFFF;
    --aig-glass-border: #E0E0E0;
}

body[data-style="te"] .login-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 2px;
    box-shadow: none;
    border: 1px solid var(--aig-glass-border);
    padding: 48px 40px;
}

body[data-style="te"] .login-card::before { display: none; }

body[data-style="te"] .login-header h1 {
    font-family: "Space Mono", monospace;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--aig-accent-primary);
    background-clip: unset;
    animation: none;
}

body[data-style="te"] .login-header p { font-family: "Space Mono", monospace; }
body[data-style="te"] .form-field label { font-family: "Space Mono", monospace; text-transform: lowercase; letter-spacing: 0.02em; }
body[data-style="te"] .form-field input { border-radius: 2px; border: 1px solid var(--aig-glass-border); background: var(--aig-bg-primary); font-family: "Space Mono", monospace; }
body[data-style="te"] .form-field input:focus { border-color: var(--aig-accent-primary); box-shadow: none; outline: 1px solid var(--aig-accent-primary); transform: none; }
body[data-style="te"] .btn-login { border-radius: 2px; background: var(--aig-accent-primary); color: #000000; box-shadow: none; font-family: "Space Mono", monospace; text-transform: lowercase; letter-spacing: 0.02em; }
body[data-style="te"] .btn-login::before { display: none; }
body[data-style="te"] .btn-login:hover { background: var(--aig-accent-tertiary); transform: none; box-shadow: none; }
body[data-style="te"] .btn-oauth { border-radius: 2px; backdrop-filter: none; border: 1px solid var(--aig-glass-border); background: transparent; font-family: "Space Mono", monospace; }
body[data-style="te"] .btn-oauth::after { display: none; }
body[data-style="te"] .btn-oauth:hover { border-color: var(--aig-accent-primary); background: rgba(255, 102, 0, 0.08); transform: none; box-shadow: none; }
body[data-style="te"] .oauth-divider span { backdrop-filter: none; background: var(--aig-bg-primary); font-family: "Space Mono", monospace; text-transform: lowercase; }
body[data-style="te"] .error-message { border-radius: 2px; animation: none; }
body[data-style="te"] .back-link { font-family: "Space Mono", monospace; text-transform: lowercase; }
body[data-style="te"] .password-strength { border-radius: 0; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
    body { padding: 16px; }
    .login-card { padding: 40px 28px; border-radius: 24px; }
    .login-header h1 { font-size: 1.875rem; }
    .form-row { flex-direction: column; gap: 20px; }
    .form-field input { padding: 14px 16px; }
    .btn-login { padding: 15px 24px; font-size: 1rem; }
    .btn-oauth { font-size: 0.9375rem; padding: 13px 20px; }
}

/* ===========================
   ACCESSIBILITY
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn-login:focus-visible,
.btn-oauth:focus-visible,
.form-field input:focus-visible {
    outline: 2px solid var(--aig-accent-primary);
    outline-offset: 3px;
}

/* Smooth theme transitions */
body, .login-card, .btn-login, .btn-oauth, .form-field input {
    transition: background-color 0.3s var(--aig-ease-out), color 0.3s var(--aig-ease-out), border-color 0.3s var(--aig-ease-out), box-shadow 0.3s var(--aig-ease-out);
}
