

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.auth-modal.active,
.auth-modal.closing {
    display: flex;
}

.auth-modal.active {
    animation: fade-in 0.3s ease forwards;
}

.auth-modal.closing {
    animation: fade-out 0.25s ease forwards;
}

.auth-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.auth-modal.active .auth-modal-content {
    animation: slide-up 0.3s ease forwards;
}

.auth-modal.closing .auth-modal-content {
    animation: slide-down 0.25s ease forwards;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.auth-modal-close:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #1e293b;
}

.auth-modal-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    padding: 30px;
    text-align: center;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.auth-modal-header h2 {
    color: #5fd4c4;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    font-family: 'Outfit', sans-serif;
}

.auth-modal-header p {
    color: #cbd5e1;
    font-size: 14px;
    margin: 0;
}

.auth-form {
    padding: 30px;
    overflow-y: auto;
    flex: 1 1 auto;

    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

/* Custom scrollbar for auth form (Webkit browsers) */
.auth-form::-webkit-scrollbar {
    width: 8px;
}

.auth-form::-webkit-scrollbar-track {
    background: transparent;
}

.auth-form::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.auth-form::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

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

.auth-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(30, 41, 59, 0.15);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
    outline: none;
    border-color: rgba(13, 174, 156, 0.3);
    box-shadow: 0 0 0 3px rgba(13, 174, 156, 0.1);
}

.auth-form .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-form .remember-me input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.auth-form .remember-me label {
    margin: 0;
    font-weight: 500;
    color: #475569;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0dae9c 0%, #5fd4c4 100%);
    color: #1e293b;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    color: #5fd4c4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider span {
    background: white;
    padding: 0 15px;
    color: #94a3b8;
    font-size: 14px;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.auth-google-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: #475569;
    border: 1px solid rgba(30, 41, 59, 0.15);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-google-btn:hover {
    background: rgba(13, 174, 156, 0.1);
    border-color: rgba(13, 174, 156, 0.3);
    color: #0dae9c;
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
}

.auth-footer p {
    margin: 8px 0;
    font-size: 14px;
    color: #64748b;
}

.auth-footer a {
    color: #0dae9c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

@keyframes slide-down {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

.auth-notification {
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.auth-notification:not(.positioned, .centered) {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(420px);
}

.auth-notification.positioned {
    position: fixed;
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

.auth-notification.positioned.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auth-notification.centered {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
}

.auth-notification.centered.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.auth-notification:not(.positioned, .centered).show {
    transform: translateX(0);
    opacity: 1;
}

.notification-arrow {
    display: none;
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.auth-notification.arrow-bottom .notification-arrow {
    display: block;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-color: white transparent transparent;
}

.auth-notification.arrow-top .notification-arrow {
    display: block;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px;
    border-color: transparent transparent white;
}

.auth-notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-notification-content i {
    font-size: 20px;
    flex-shrink: 0;
}

.auth-notification-content p {
    margin: 0;
    flex: 1;
    font-size: 14px;
    color: #475569;
}

.auth-notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-notification-close:hover {
    color: #1e293b;
}

.auth-notification-success {
    border-left: 4px solid #22c55e;
}

.auth-notification-success i {
    color: #22c55e;
}

.auth-notification-error {
    border-left: 4px solid #ef4444;
}

.auth-notification-error i {
    color: #ef4444;
}

.auth-notification-info {
    border-left: 4px solid #0dae9c;
}

.auth-notification-info i {
    color: #0dae9c;
}

.auth-notification-warning {
    border-left: 4px solid #f59e0b;
}

.auth-notification-warning i {
    color: #f59e0b;
}

.auth-container {
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.auth-icon {
    font-size: 48px;
    color: #5fd4c4;
    margin-bottom: 20px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
}

.auth-header p {
    font-size: 16px;
    color: #cbd5e1;
    margin: 0;
}

.auth-content {
    padding: 40px 30px;
}

.auth-benefits {
    margin-bottom: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #475569;
    font-size: 15px;
}

.benefit-item i {
    color: #10b981;
    font-size: 18px;
}

.auth-actions {
    margin-top: 30px;
}

.google-signin-btn {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-signin-btn:hover {
    background: #f9fafb;
    border-color: #0dae9c;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

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

.auth-terms {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.auth-terms a {
    color: #0dae9c;
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Above auth modal (10000) */
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.loading-spinner i {
    font-size: 48px;
    color: #0dae9c;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 16px;
    color: #475569;
    margin: 0;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-menu-toggle:hover {
    background: rgba(13, 174, 156, 0.08);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #5fd4c4;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.user-dropdown-email {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.user-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    margin-top: 4px;
}

.user-provider-badge i {
    font-size: 11px;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    transition: background 0.2s ease;
}

.user-dropdown-item:hover {
    background: #f9fafb;
    color: #0dae9c;
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.5rem;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.login-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

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

.notification i {
    font-size: 20px;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-success i {
    color: #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error i {
    color: #ef4444;
}

.notification-info {
    border-left: 4px solid #0dae9c;
}

.notification-info i {
    color: #0dae9c;
}

.auth-cancel-btn {
    padding: 10px 24px;
    background: rgba(30, 41, 59, 0.05);
    border: 1px solid rgba(30, 41, 59, 0.15);
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.auth-cancel-btn:hover {
    background: rgba(13, 174, 156, 0.1);
    border-color: rgba(13, 174, 156, 0.3);
    color: #0dae9c;
}

.auth-cancel-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 174, 156, 0.2);
}

@media (max-width: 768px) {
    .auth-modal {
        padding: 1rem;
        padding-top: max(1rem, env(safe-area-inset-top, 1rem));
        align-items: flex-end;
    }

    .auth-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(85vh - env(safe-area-inset-top, 0px));
        margin: 0;
        border-radius: 24px 24px 0 0;
    }

    .auth-modal.active .auth-modal-content {
        animation: slide-up-mobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .auth-modal.closing .auth-modal-content {
        animation: slide-down-mobile 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .auth-modal-header {
        padding: 24px 20px;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
    }

    .auth-modal-header h2 {
        font-size: 22px;
        margin: 0 0 6px;
    }

    .auth-modal-header p {
        font-size: 13px;
    }

    .auth-modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 26px;
        background: rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
        aspect-ratio: 1;
    }

    .auth-form {
        padding: 20px;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .form-group input {
        padding: 0.75rem;
        font-size: 16px;
        min-height: 48px;
    }

    .auth-submit-btn,
    .auth-google-btn {
        padding: 14px;
        font-size: 15px;
        min-height: 50px;
        border-radius: 12px;
    }

    .auth-footer {
        font-size: 0.875rem;
    }

    .benefit-item {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .benefit-item i {
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .auth-modal {
        padding: 0;
        padding-top: env(safe-area-inset-top, 10px);
        align-items: flex-end;
        background: rgba(0, 0, 0, 0.7);
    }

    .auth-modal-content {
        width: 100%;
        max-height: calc(95vh - env(safe-area-inset-top, 10px));
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }

    .auth-modal-header {
        padding: 20px;
        padding-top: 28px;
        position: relative;
    }

    .auth-modal-header i {
        display: none;
    }

    .auth-modal-header h2 {
        font-size: 20px;
        margin: 0 0 4px;
    }

    .auth-modal-header p {
        font-size: 12px;
        opacity: 0.9;
    }

    .auth-modal-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 24px;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        flex-shrink: 0;
        aspect-ratio: 1;
    }

    .auth-modal-close:hover {
        background: rgba(255, 255, 255, 0.25);
        color: white;
    }

    .auth-form {
        padding: 20px;
        padding-top: 10px;
    }

    .auth-benefits {
        margin-bottom: 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .benefit-item {
        font-size: 13px;
        margin-bottom: 0;
    }

    .benefit-item i {
        font-size: 14px;
    }

    .auth-google-btn {
        background: linear-gradient(135deg, #0dae9c 0%, #5fd4c4 100%);
        color: white;
        border: none;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(13, 174, 156, 0.3);
    }

    .auth-google-btn:hover {
        background: linear-gradient(135deg, #0b9987 0%, #4fc3b3 100%);
        transform: translateY(-1px);
    }

    .auth-google-btn img {
        filter: brightness(0) invert(1);
    }

    .auth-divider {
        margin: 20px 0;
    }

    .auth-divider span {
        font-size: 12px;
    }

    .auth-terms {
        font-size: 11px;
        line-height: 1.5;
        padding: 0 10px;
        color: #64748b;
    }

    .auth-card {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .auth-container {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        max-height: 92vh;
    }

    .auth-modal-header {
        padding: 16px;
        padding-top: 24px;
    }

    .auth-modal-header h2 {
        font-size: 18px;
    }

    .auth-form {
        padding: 16px;
    }

    .auth-benefits {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .benefit-item {
        font-size: 12px;
    }

    .auth-notification {
        max-width: calc(100% - 40px);
    }

    .auth-notification.positioned,
    .auth-notification.centered,
    .auth-notification:not(.positioned, .centered) {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.9);
    }

    .auth-notification.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .notification-arrow {
        display: none !important;
    }

    .auth-notification-content {
        padding: 12px 16px;
    }

    .auth-notification-content p {
        font-size: 13px;
    }
}

@keyframes slide-up-mobile {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slide-down-mobile {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

@keyframes scale-in {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for shake effect on error */
.shake-animation {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

/* Spinning loader animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Fade in animation */
@keyframes fade-in-text {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Shimmer effect animation */
@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Mobile optimizations - hide specific elements on mobile and low resolution devices */
@media (max-width: 768px) {
    .auth-modal-plane-icon {
        display: none;
    }

    .auth-modal-subtitle {
        display: none;
    }

    .benefit-item-recommendations {
        display: none !important;
    }

    /* Display benefits vertically (one per row) */
    .auth-benefits {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .benefit-item {
        margin-bottom: 0 !important;
    }

    /* Adjust modal positioning to center it vertically */
    .auth-modal {
        align-items: center;
        justify-content: center;
    }

    .auth-modal-content {
        position: relative;
        border-radius: 16px;
    }
}
