/* ═══════════════════════════════════════════════════════════
   Login & Setup Pages — Light Theme
   Matches Schema Command Center design language
   ═══════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1f36 0%, #252b43 40%, #2d3555 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

/* Animated background shapes */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #4ecdc4 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: floatBg 20s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #4ecdc4 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: floatBg 25s ease-in-out infinite reverse;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

/* ─── Login Container ─────────────────────────────────── */

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Card Header ─────────────────────────────────────── */

.login-header {
    background: linear-gradient(135deg, #1a1f36 0%, #252b43 100%);
    padding: 36px 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234ecdc4' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(78, 205, 196, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.login-logo svg {
    width: 30px;
    height: 30px;
    stroke: #4ecdc4;
}

.login-header h1 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

.login-header p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13.5px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ─── Card Body ───────────────────────────────────────── */

.login-body {
    padding: 36px 40px 40px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: #9ca3af;
    pointer-events: none;
    transition: stroke 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    color: #1a1f36;
    background: #f9fafb;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #4ecdc4;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.12);
}

.input-wrapper input:focus + svg,
.input-wrapper input:focus ~ svg {
    stroke: #4ecdc4;
}

.input-wrapper input::placeholder {
    color: #b0b7c3;
}

/* Password visibility toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #4ecdc4;
}

.toggle-password svg {
    position: static;
    transform: none;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* ─── Error Message ───────────────────────────────────── */

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: none;
    align-items: flex-start;
    gap: 10px;
    animation: shakeIn 0.4s ease;
}

.error-message.visible {
    display: flex;
}

.error-message svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: #ef4444;
    margin-top: 1px;
}

.error-message span {
    color: #991b1b;
    font-size: 13.5px;
    line-height: 1.45;
}

@keyframes shakeIn {
    0% { transform: translateX(-8px); opacity: 0; }
    25% { transform: translateX(6px); }
    50% { transform: translateX(-4px); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); opacity: 1; }
}

/* Success message */
.success-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.success-message.visible {
    display: flex;
}

.success-message svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: #10b981;
}

.success-message span {
    color: #065f46;
    font-size: 13.5px;
}

/* ─── Submit Button ───────────────────────────────────── */

.btn-login {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44b8b0 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background: linear-gradient(135deg, #44b8b0 0%, #3aa89f 100%);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.35);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(78, 205, 196, 0.3);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

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

/* ─── Footer ──────────────────────────────────────────── */

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12.5px;
}

.login-footer svg {
    width: 14px;
    height: 14px;
    stroke: rgba(255, 255, 255, 0.3);
    vertical-align: -2px;
    margin-right: 4px;
}

/* ─── Setup Page Extras ───────────────────────────────── */

.setup-intro {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.setup-intro svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    stroke: #14b8a6;
    margin-top: 1px;
}

.setup-intro p {
    color: #134e4a;
    font-size: 13px;
    line-height: 1.5;
}

.password-requirements {
    margin-top: 6px;
    padding-left: 2px;
}

.password-requirements li {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 3px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-requirements li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

.password-requirements li.met::before {
    background: #10b981;
}

.password-requirements li.met {
    color: #059669;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
    .login-header {
        padding: 28px 24px 24px;
    }
    
    .login-body {
        padding: 28px 24px 32px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
}