@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500&family=Inter:wght@400;500;600&display=swap');

/* CSS Variables - Google Workspace Theme */
:root {
    --google-blue: #1a73e8;
    --google-blue-hover: #1557b0;
    --google-blue-light: #e8f0fe;
    --google-text-primary: #202124;
    --google-text-secondary: #5f6368;
    --google-text-tertiary: #80868b;
    --google-border: #dadce0;
    --google-border-focus: #1a73e8;
    --google-error: #d93025;
    --google-error-bg: #fce8e6;
    --google-success: #1e8e3e;
    --google-bg: #f8f9fa;
    --google-white: #ffffff;
    --google-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --google-shadow-hover: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --transition-fast: 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-sm: 4px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0a0a0a;
    background-image:
        /* Subtle noise/grain texture */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E"),
        /* Gold accent lines - diagonal */
        repeating-linear-gradient(135deg, transparent, transparent 300px, rgba(184, 134, 11, 0.25) 300px, rgba(184, 134, 11, 0.25) 302px),
        repeating-linear-gradient(45deg, transparent, transparent 250px, rgba(218, 165, 32, 0.2) 250px, rgba(218, 165, 32, 0.2) 252px),
        /* Topographic contour lines - concentric circles */
        radial-gradient(ellipse at 20% 30%, transparent 100px, rgba(60, 60, 60, 0.8) 101px, transparent 103px),
        radial-gradient(ellipse at 20% 30%, transparent 200px, rgba(55, 55, 55, 0.6) 201px, transparent 203px),
        radial-gradient(ellipse at 20% 30%, transparent 300px, rgba(50, 50, 50, 0.5) 301px, transparent 303px),
        radial-gradient(ellipse at 20% 30%, transparent 400px, rgba(45, 45, 45, 0.4) 401px, transparent 403px),
        radial-gradient(ellipse at 80% 70%, transparent 150px, rgba(60, 60, 60, 0.7) 151px, transparent 153px),
        radial-gradient(ellipse at 80% 70%, transparent 250px, rgba(55, 55, 55, 0.5) 251px, transparent 253px),
        radial-gradient(ellipse at 80% 70%, transparent 350px, rgba(50, 50, 50, 0.4) 351px, transparent 353px),
        /* Copper accent contour */
        radial-gradient(ellipse at 50% 50%, transparent 500px, rgba(179, 102, 49, 0.15) 501px, transparent 504px),
        /* Base charcoal gradient */
        linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    color: var(--google-text-primary);
    background-attachment: fixed;
    background-size: 200px 200px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Main Container */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    min-height: 100vh;
    position: relative;
}

/* Login Card */
.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--google-white);
    border-radius: 12px;
    border: 1px solid rgba(218, 165, 32, 0.1);
    padding: 48px 40px;
    box-shadow:
        0 0 0 1px rgba(184, 134, 11, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(184, 134, 11, 0.08);
    position: relative;
    backdrop-filter: blur(10px);
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        border: 1px solid rgba(218, 165, 32, 0.1);
        box-shadow:
            0 0 0 1px rgba(184, 134, 11, 0.05),
            0 10px 30px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(184, 134, 11, 0.06);
        background: var(--google-white);
    }

    .login-container {
        padding: 24px 16px;
    }
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-section img {
    max-height: 60px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: var(--google-text-primary);
    letter-spacing: -0.25px;
}

/* Heading Section */
.heading-section {
    text-align: center;
    margin-bottom: 32px;
}

.heading-title {
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--google-text-primary);
    margin-bottom: 8px;
    letter-spacing: normal;
}

.heading-subtitle {
    font-size: 16px;
    color: var(--google-text-secondary);
    font-weight: 400;
}

/* Alert/Error Messages */
.alert-google {
    background: var(--google-error-bg);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--google-error);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-google i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-google span {
    flex: 1;
}

/* Form Group with Fixed Labels */
.form-group-google {
    position: relative;
    margin-bottom: 24px;
}

.input-google {
    width: 100%;
    padding: 13px 15px;
    font-size: 16px;
    font-family: inherit;
    color: var(--google-text-primary);
    background: var(--google-white);
    border: 1px solid var(--google-border);
    border-radius: var(--border-radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-google:hover {
    border-color: var(--google-text-secondary);
}

.input-google:focus {
    border-color: var(--google-blue);
    box-shadow: 0 0 0 1px var(--google-blue);
}

.input-google.is-invalid {
    border-color: var(--google-error);
}

.input-google.is-invalid:focus {
    box-shadow: 0 0 0 1px var(--google-error);
}

/* Fixed Label - Always at top */
.floating-label {
    position: absolute;
    left: 12px;
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--google-text-secondary);
    pointer-events: none;
    background: var(--google-white);
    padding: 0 4px;
    font-weight: 500;
    z-index: 1;
}

.input-google:focus ~ .floating-label {
    color: var(--google-blue);
}

.input-google.is-invalid ~ .floating-label {
    color: var(--google-error);
}

/* Password wrapper for toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .input-google {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--google-text-secondary);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.password-toggle:hover {
    background-color: rgba(60, 64, 67, 0.08);
}

.password-toggle:focus {
    outline: none;
    background-color: rgba(60, 64, 67, 0.12);
}

/* Forgot Password Link */
.forgot-password-link {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--google-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Remember Me Checkbox */
.remember-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    cursor: pointer;
}

.checkbox-google {
    width: 18px;
    height: 18px;
    accent-color: var(--google-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.remember-label {
    font-size: 14px;
    color: var(--google-text-primary);
    cursor: pointer;
    user-select: none;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
}

/* Create Account Link */
.create-account-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--google-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.create-account-link:hover {
    color: var(--google-blue-hover);
    text-decoration: underline;
}

/* Primary Button - Google Style */
.btn-google-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 52px;
    padding: 0 48px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Google Sans', 'Inter', sans-serif;
    color: var(--google-white);
    background-color: var(--google-blue);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.btn-google-primary:hover {
    background-color: #1b66c9;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-google-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--google-white), 0 0 0 4px var(--google-blue);
}

.btn-google-primary:active {
    background-color: var(--google-blue-hover);
}

.btn-google-primary:disabled {
    background-color: rgba(26, 115, 232, 0.4);
    cursor: not-allowed;
}

/* Full width button variant */
.btn-google-primary.btn-full {
    width: 100%;
    height: 48px;
    font-size: 15px;
    border-radius: var(--border-radius-sm);
}

/* Secondary/Outlined Button */
.btn-google-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Inter', sans-serif;
    color: var(--google-text-primary);
    background-color: var(--google-white);
    border: 1px solid var(--google-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}

.btn-google-secondary:hover {
    background-color: var(--google-blue-light);
    border-color: var(--google-blue-light);
}

.btn-google-secondary:focus {
    outline: none;
    border-color: var(--google-blue);
    box-shadow: 0 0 0 1px var(--google-blue);
}

.btn-google-secondary i {
    font-size: 18px;
    color: var(--google-text-secondary);
}

/* Divider */
.divider-google {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--google-border);
}

.divider-text {
    padding: 0 16px;
    font-size: 12px;
    color: var(--google-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--google-border);
}

.footer-logo {
    margin-bottom: 16px;
}

.footer-logo img {
    max-width: 120px;
    height: auto;
    opacity: 0.7;
}

.footer-text {
    font-size: 12px;
    color: var(--google-text-tertiary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.footer-text a {
    color: var(--google-text-secondary);
    text-decoration: none;
}

.footer-text a:hover {
    color: var(--google-blue);
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.footer-links a {
    font-size: 12px;
    color: var(--google-text-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--google-blue);
}

/* Page Footer - Bottom of page */
.page-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--google-bg);
    border-top: 1px solid var(--google-border);
}

.page-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-footer-left select {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--google-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.page-footer-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.page-footer-right a {
    font-size: 13px;
    color: var(--google-text-tertiary);
    text-decoration: none;
}

.page-footer-right a:hover {
    color: var(--google-text-primary);
}

@media (max-width: 480px) {
    .page-footer {
        justify-content: center;
        text-align: center;
    }

    .page-footer-left,
    .page-footer-right {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.btn-loading {
    pointer-events: none;
    position: relative;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--google-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--google-blue);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Show Password icon states */
.password-toggle .fa-eye,
.password-toggle .fa-eye-slash {
    font-size: 18px;
}

/* Helper text below inputs */
.input-helper {
    font-size: 12px;
    color: var(--google-text-tertiary);
    margin-top: 6px;
    padding-left: 16px;
}

.input-helper.error {
    color: var(--google-error);
}

/* Animation for card entrance */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: cardFadeIn 0.3s ease-out;
}

/* Social login buttons with icons */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Inter', sans-serif;
    color: var(--google-text-primary);
    background-color: var(--google-white);
    border: 1px solid var(--google-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}

.btn-social:hover {
    background-color: #f8f9fa;
}

.btn-social:focus {
    outline: none;
    border-color: var(--google-blue);
}

.btn-social img {
    width: 20px;
    height: 20px;
}

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

/* Magic link styling */
.magic-link-section {
    margin-top: 24px;
}
