/* Authentication Modal Styles - Premium Redesign */
/* Implements Glassmorphism and Material 3 Principles */

:root {
    --auth-glass-bg: rgba(255, 255, 255, 0.7);
    --auth-glass-border: rgba(255, 255, 255, 0.4);
    --auth-radius: 28px;
    --auth-shadow: 0 24px 48px rgba(0, 0, 0, 0.1);
    --auth-primary-gradient: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    --auth-input-bg: rgba(241, 243, 244, 0.5);
}

/* Modal Overlay */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(32, 33, 36, 0.4);
    z-index: 10001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-modal-overlay.active {
    display: block;
    animation: authFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Container */
.auth-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--auth-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius);
    width: 90%;
    max-width: 440px;
    z-index: 10002;
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-modal.active {
    display: block;
    animation: authModalEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal-content {
    padding: 40px;
    position: relative;
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--google-grey-700);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    z-index: 10;
}

.close-modal:hover {
    background-color: rgba(60, 64, 67, 0.1);
    color: var(--google-grey-900);
    transform: rotate(90deg);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 32px;
    position: relative;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--google-grey-700);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.auth-tab.active {
    color: white;
    background: var(--auth-primary-gradient);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

/* Forms */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
    animation: authFormSlide 0.4s cubic-bezier(0.2, 0, 0.1, 1);
}

.auth-form h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--google-grey-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-form p {
    color: var(--google-grey-700);
    margin-bottom: 32px;
    font-size: 15px;
}

/* Inputs */
.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--google-grey-700);
    margin-bottom: 8px;
    margin-left: 4px;
}

.auth-form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--auth-input-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 16px;
    color: var(--google-grey-900);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form-input:focus {
    outline: none;
    background: white;
    border-color: var(--google-blue-600);
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.1);
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--auth-primary-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
    box-shadow: 0 8px 16px rgba(26, 115, 232, 0.2);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(26, 115, 232, 0.3);
}

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

/* Navigation Links */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--google-grey-700);
}

.auth-switch a {
    color: var(--google-blue-600);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
}

.auth-forgot-password {
    text-align: center;
    margin-top: 16px;
}

.auth-forgot-link {
    font-size: 13px;
    color: var(--google-grey-600);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-forgot-link:hover {
    color: var(--google-blue-600);
}

/* Error Messages */
.auth-error-message {
    background: rgba(217, 48, 37, 0.1);
    color: #d93025;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(217, 48, 37, 0.2);
}

.auth-error-message.active {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: authShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Success Messages */
.auth-success-message {
    background: rgba(30, 142, 62, 0.1);
    color: #1e8e3e;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(30, 142, 62, 0.2);
}

.auth-success-message.active {
    display: block;
}

/* Helper Text */
.auth-helper-text {
    display: block;
    font-size: 11px;
    color: var(--google-grey-600);
    margin-top: 6px;
    margin-left: 4px;
    font-style: italic;
}


/* Animations */
@keyframes authFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authModalEnter {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes authFormSlide {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

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

@keyframes authShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Toast System (Material 3 style) */
.auth-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323336;
    color: white;
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 20001;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-toast.active {
    transform: translateX(-50%) translateY(0);
}

.auth-toast.success i {
    color: #81c995;
}

.auth-toast.error i {
    color: #f28b82;
}

/* Mobile Adaptations */
@media (max-width: 480px) {
    .auth-modal {
        width: 95%;
        border-radius: 24px;
    }

    .auth-modal-content {
        padding: 32px 24px;
    }
}