/* ============================================
   Apple-Inspired Login Page Styles
   Premium CRM Design System
   ============================================ */

/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
    /* Colors - Google-inspired minimal palette */
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --primary-light: rgba(26, 115, 232, 0.1);

    --secondary-color: #34a853;
    --success-color: #34a853;
    --warning-color: #fbbc04;
    --danger-color: #ea4335;

    /* Neutral Colors */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #9aa0a6;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.95);

    /* Gradients - Subtle and minimal */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);


    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Global Styles & Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: #f5f5f7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Clean Background - Google Style
   ============================================ */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--gradient-bg);
    overflow: hidden;
}

/* ============================================
   Login Card
   ============================================ */
.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ============================================
   Logo Section
   ============================================ */
.logo-section {
    margin-bottom: var(--spacing-xl);
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.logo-icon i {
    font-size: 32px;
    color: white;
}

.app-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* ============================================
   Form Styles
   ============================================ */
.login-form {
    margin-top: var(--spacing-lg);
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.input-wrapper {
    position: relative;
    margin-bottom: 0;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    transition: color var(--transition-fast);
    z-index: 1;
}

.custom-input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
    display: block;
}

.custom-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.custom-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.custom-input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition-fast);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 24px;
    width: 24px;
    min-height: 24px;
    min-width: 24px;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle:focus {
    outline: none;
}

.password-toggle i {
    display: block;
    line-height: 1;
}

/* Form text (small helper text) */
.form-text {
    display: block;
    margin-top: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
}

.custom-checkbox .form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-checkbox .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox .form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

/* Forgot Password Link */
.forgot-password {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

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

/* Back Link */
.back-link {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-link:hover {
    color: var(--primary-color);
}

/* ============================================
   Buttons
   ============================================ */
.custom-btn {
    padding: 12px 24px;
    font-size: var(--font-size-md);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.custom-btn:active {
    transform: scale(0.98);
}

/* Outline Button */
.custom-btn-outline {
    padding: 12px 24px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.custom-btn-outline:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.custom-btn-outline i {
    font-size: 20px;
}

/* ============================================
   Divider
   ============================================ */
.divider {
    position: relative;
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 var(--spacing-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ============================================
   Footer
   ============================================ */
.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: var(--spacing-md);
}

.footer-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================
   Security Badge
   ============================================ */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: 500;
    animation: fadeIn 1s ease-out 0.3s both;
}

.security-badge i {
    font-size: 16px;
    color: var(--success-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .login-card {
        padding: var(--spacing-lg);
    }

    .logo-icon {
        width: 70px;
        height: 70px;
    }

    .logo-icon i {
        font-size: 35px;
    }

    .app-title {
        font-size: 28px;
    }

    .gradient-sphere {
        filter: blur(60px);
    }
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
    .login-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .logo-icon i {
        font-size: 30px;
    }

    .app-title {
        font-size: 24px;
    }

    .app-subtitle {
        font-size: 13px;
    }

    .custom-input {
        padding: 12px 14px 12px 44px;
        font-size: 15px;
    }

    .custom-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .gradient-sphere {
        filter: blur(40px);
    }

    .sphere-1 {
        width: 250px;
        height: 250px;
    }

    .sphere-2 {
        width: 300px;
        height: 300px;
    }

    .sphere-3 {
        width: 200px;
        height: 200px;
    }
}

/* Small Mobile (400px and below) */
@media (max-width: 400px) {
    .login-card {
        padding: 20px;
    }

    .custom-checkbox .form-check-label {
        font-size: 12px;
    }

    .forgot-password {
        font-size: 12px;
    }
}

/* ============================================
   Accessibility & Print Styles
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F5F5F7;
        --text-secondary: #98989D;
        --text-tertiary: #48484A;
        --bg-primary: #000000;
        --bg-secondary: #1C1C1E;
        --bg-glass: rgba(28, 28, 30, 0.7);
    }

    .custom-input {
        background: rgba(28, 28, 30, 0.9);
        color: var(--text-primary);
    }

    .custom-input:focus {
        background: rgba(28, 28, 30, 1);
    }
}
/* ============================================
   Settings Page Additions
   ============================================ */

/* Section Divider */
.section-divider {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Custom Outline Button */
.custom-btn-outline {
    padding: 12px 24px;
    font-size: var(--font-size-md);
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.custom-btn-outline:active {
    transform: scale(0.98);
}

/* Select Dropdown Styling */
select.custom-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235f6368' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

