/**
 * Authentication UI Styles
 * Paper Pulltabs Digital
 */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.auth-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.auth-modal {
    background: linear-gradient(145deg, #1a2744 0%, #0d1829 100%);
    border-radius: 20px;
    padding: 35px 40px;
    width: 90%;
    max-width: 420px;
    border: 2px solid #3498db;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(52, 152, 219, 0.2);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.auth-modal-overlay.show .auth-modal {
    transform: scale(1);
}

/* Close Button */
.auth-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.auth-close:hover {
    color: #fff;
}

/* View Management */
.auth-view {
    transition: opacity 0.2s ease;
}

.auth-view.hidden {
    display: none;
}

/* Title & Subtitle */
.auth-title {
    color: #f1c40f;
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-subtitle {
    color: #95a5a6;
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Social Buttons */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn.loading {
    position: relative;
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.auth-btn-google {
    background: #fff;
    color: #333;
}

.auth-btn-google:hover:not(:disabled) {
    background: #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.auth-btn-apple {
    background: #000;
    color: #fff;
}

.auth-btn-apple:hover:not(:disabled) {
    background: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.auth-btn-primary {
    background: linear-gradient(145deg, #27ae60, #1e8449);
    color: #fff;
}

.auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    transform: translateY(-2px);
}

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

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.auth-divider span {
    color: #7f8c8d;
    padding: 0 15px;
    font-size: 0.85em;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.auth-input-group label {
    color: #95a5a6;
    font-size: 0.9em;
    font-weight: 500;
}

.auth-input-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-size: 1em;
    transition: all 0.2s ease;
}

.auth-input-group input:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.15);
}

.auth-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Error Message */
.auth-error {
    color: #e74c3c;
    font-size: 0.9em;
    text-align: center;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.auth-error.show {
    opacity: 1;
}

/* Toggle Sign In/Up */
.auth-toggle {
    text-align: center;
    margin-top: 20px;
    color: #95a5a6;
    font-size: 0.9em;
}

.auth-link {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    margin-left: 5px;
}

.auth-link:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Initials Input */
.auth-initials-input {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.auth-initials-input input {
    width: 60px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #f1c40f;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.auth-initials-input input:focus {
    outline: none;
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

/* User Badge */
.user-badge {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.user-badge-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(145deg, #1e3a5f, #152238);
    border: 2px solid #3498db;
    border-radius: 25px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-badge-btn:hover {
    border-color: #f1c40f;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.user-initials {
    color: #f1c40f;
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: 1px;
}

.user-badge-arrow {
    color: #7f8c8d;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.user-badge.menu-open .user-badge-arrow {
    transform: rotate(180deg);
}

/* Badge Dropdown Menu */
.user-badge-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: linear-gradient(145deg, #1e3a5f, #152238);
    border: 2px solid #3498db;
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-badge.menu-open .user-badge-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-badge-info {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-email {
    color: #95a5a6;
    font-size: 0.9em;
    word-break: break-all;
}

.user-badge-item {
    display: block;
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    color: #e74c3c;
    text-align: left;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s ease;
}

.user-badge-item:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Not Signed In State */
.user-badge:not(.signed-in) .user-badge-btn {
    border-color: #7f8c8d;
}

.user-badge:not(.signed-in) .user-initials {
    color: #7f8c8d;
}

.user-badge:not(.signed-in) .user-badge-arrow {
    display: none;
}

/* Invite Code Request Link */
.auth-request-link {
    display: block;
    font-size: 0.85em;
    color: #3498db;
    text-decoration: none;
    margin-top: 8px;
    text-align: right;
    transition: color 0.2s ease;
}

.auth-request-link:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .auth-modal {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .auth-title {
        font-size: 1.5em;
    }

    .auth-initials-input input {
        width: 50px;
        height: 60px;
        font-size: 1.6em;
    }

    .user-badge {
        top: 10px;
        right: 10px;
    }

    .user-badge-btn {
        padding: 6px 12px;
    }
}
