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

:root {
    --primary-color: #CC11DC;
    --primary-dark: #B010C2;
    --primary-light: #E033F0;
    --secondary-color: #6B46C1;
    --accent-color: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --background-white: #FFFFFF;
    --background-gray: #F9FAFB;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== LOGIN CONTAINER ==================== */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Figma-like background frame */
.bg-frame {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
    background-image: url('../img/background.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 0.4;
}

/* ==================== LOGIN CARD ==================== */
/* Main wrapper and pink panel from Figma */
.main-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1280px;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pink-panel {
    width: 100%;
    border-radius: 24px;
    padding: 40px;
    background: rgba(204, 17, 220, 0.0667);
    box-shadow: 0px 6px 6px rgba(0, 0, 0, 0.35);
    position: relative;
}

/* Single pink panel layer (removed extra layers) */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 40px;
    align-items: center;
}

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

/* ==================== LOGIN HEADER ==================== */
/* Figma typography styles */
.figma-header { text-align: left; margin-bottom: 24px; }
.title {
    font-size: 48px;
    font-weight: 700;
    color: #26599F;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
    font-family: 'Cardo', serif;
}
.subtitle {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    text-shadow: 0px 1px 2px rgba(255, 255, 255, 0.8);
    font-family: 'Cardo', serif;
}

.figma-label {
    display: block;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: #1e4a7a;
    margin-bottom: 8px;
    font-family: 'Cardo', serif;
}
.form-column { max-width: 400px; width: 100%; margin: 0; }
.visual-column { position: relative; height: 520px; }
.logo-visual { position: absolute; top: 0; right: 120px; width: 340px; height: auto; z-index: 2; }
.cake-visual { position: absolute; right: 80px; bottom: 0; width: 420px; height: auto; transform: rotate(10.71deg); transform-origin: center; z-index: 1; }

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    font-size: 18px;
    z-index: 2;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 400;
    background: var(--background-white);
    transition: var(--transition);
    outline: none;
}

/* Center text input to match Figma fields */
.center-input input { text-align: left; box-shadow: 0px 5px 8px rgba(0, 0, 0, 0.6); background: #ffffff !important; }

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 17, 220, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:not(:placeholder-shown) + .input-icon {
    color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: rgba(204, 17, 220, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    font-weight: 500;
    margin-left: 4px;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition);
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== FORM OPTIONS ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.figma-row { font-family: 'Cardo', serif; }
.figma-row .remember-me { color: #000000; }
.figma-row .forgot-password { color: #000000; }

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
}

.remember-me input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== LOGIN BUTTON ==================== */
.login-btn {
    width: 100%;
    padding: 16px;
    background: #1e4a7a;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.figma-btn { box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.35); border-radius: 28px; }

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== LOGIN FOOTER ==================== */
/* Removed legacy footer section in new layout */

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    z-index: 1000;
    transform: translateX(400px);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success-color);
}

.toast.error .toast-icon::before {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--error-color);
}

.toast.warning .toast-icon::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--warning-color);
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .login-container { padding: 16px; }
    .bg-frame { top: 16px; right: 16px; bottom: 16px; left: 16px; }
    .pink-panel { padding: 20px; }
    .content-grid { grid-template-columns: 1fr; gap: 24px; }
    .visual-column { height: 360px; }
    .logo-visual { width: 220px; right: 60px; }
    .cake-visual { width: 300px; right: 40px; }
    
    .title { font-size: 32px; }
    .subtitle { font-size: 16px; }
    
    .input-wrapper input { padding: 14px 14px 14px 44px; font-size: 16px; }
    
    .input-icon { left: 14px; font-size: 16px; }
    
    .toggle-password { right: 14px; }
    
    .form-options { flex-direction: column; gap: 12px; align-items: flex-start; }
    
    .toast { right: 16px; left: 16px; min-width: auto; transform: translateY(-100px); }
    
    .toast.show { transform: translateY(0); }
}

@media (max-width: 480px) {
    .pink-panel { padding: 20px; }
}

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

/* Focus styles for keyboard navigation */
.login-btn:focus,
.input-wrapper input:focus,
.toggle-password:focus,
.forgot-password:focus,
.register-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-white: #1F2937;
        --background-gray: #111827;
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --text-light: #9CA3AF;
        --border-color: #374151;
    }
}
