/* ========================================
   Authentication Styles - Gaming Platform
   ======================================== */

/* Auth Container */
.auth-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-lg);
}

@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        padding: var(--spacing-lg) var(--spacing-sm);
        gap: var(--spacing-xl);
    }
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: var(--spacing-md) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 968px) {
    .hero-section {
        text-align: center;
        padding: var(--spacing-md) 0;
    }
}

.hero-logo {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 4px 12px rgba(0, 217, 255, 0.4));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

@media (max-width: 968px) {
    .hero-stats {
        justify-content: center;
    }
}

.stat-pill {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 1.3rem;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 968px) {
    .auth-header {
        display: none;
    }
}

.auth-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    display: none;
}

/* Unified Auth Card */
.auth-card-unified {
    background: linear-gradient(135deg, rgba(20, 24, 36, 0.8), rgba(30, 36, 48, 0.6));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .auth-card-unified {
        border-radius: var(--radius-xl);
        padding: var(--spacing-lg);
    }
}

/* Method Switcher */
.method-switcher {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.method-tab {
    padding: var(--spacing-sm) var(--spacing-xs);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.method-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(179, 136, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.method-tab span {
    font-size: 1.5rem;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.method-tab:hover {
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

.method-tab:hover span {
    filter: grayscale(0%);
}

.method-tab.active {
    background: rgba(0, 217, 255, 0.15);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.method-tab.active::before {
    opacity: 1;
}

.method-tab.active span {
    filter: grayscale(0%) drop-shadow(0 2px 8px rgba(0, 217, 255, 0.5));
    transform: scale(1.1);
}

/* Method Content */
.auth-method-content {
    display: none;
    min-height: 220px;
}

.auth-method-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.auth-method-content .btn-auth {
    margin-top: auto;
}

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

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

.method-description {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.method-description h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.method-description p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Auth Buttons */
.btn-auth {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-auth:hover::before {
    width: 400px;
    height: 400px;
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-auth-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-auth-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.5);
}

.btn-auth-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-auth-secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.2);
}

.btn-auth-secondary:active {
    transform: translateY(-1px);
}

.btn-auth-tertiary {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    color: var(--text-primary);
    border: 2px solid rgba(255, 193, 7, 0.5);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.btn-auth-tertiary:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.15));
    border-color: rgba(255, 193, 7, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

.btn-auth-tertiary:active {
    transform: translateY(-1px);
}

/* Inline Auth Form */
.auth-form-inline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: var(--spacing-xs) 0 var(--spacing-sm) 0;
}

.form-group-compact {
    width: 100%;
}

.form-group-compact input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group-compact input::placeholder {
    color: var(--text-muted);
}

.form-group-compact input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.form-group-compact input[type="password"] {
    font-family: monospace;
    letter-spacing: 0.1em;
}

.form-group-compact input[type="password"]::placeholder {
    font-family: inherit;
    letter-spacing: normal;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Auth Status Messages */
.auth-status {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease;
}

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

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

.auth-status.info {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.auth-status.success {
    background: rgba(105, 240, 174, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.auth-status.error {
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Loading Animation */
.auth-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: var(--spacing-sm);
}

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

/* Auth Footer */
.auth-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* User Info in Navigation */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.user-info #userName {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}


.btn-logout {
    /* Always show logout as a solid error (red) button */
    background: linear-gradient(135deg, var(--error), #dc2626);
    border: none;
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 61, 113, 0.3);
}

.btn-logout:hover {
    /* Keep the same appearance on hover (no color change) */
    background: linear-gradient(135deg, var(--error), #dc2626);
    transform: none;
    box-shadow: 0 2px 8px rgba(255, 61, 113, 0.3);
}

/* Ensure the moved logout button behaves correctly in mobile menu */
@media (max-width: 768px) {
    .nav-logout .btn-logout {
        width: 100%;
        padding: var(--spacing-sm);
        display: block;
    }
}

/* Modal Styles (for existing modal in index.html) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--background-light);
    margin: 5% auto;
    padding: var(--spacing-2xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-weight: 600;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-primary);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Auth Info Box */
.auth-info {
    background: var(--surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 3px solid var(--primary-color);
}

.auth-info p {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.benefits-list {
    list-style: none;
    padding: 0;
}

.benefits-list li {
    color: var(--text-secondary);
    padding: var(--spacing-xs) 0;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-group input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.2);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--spacing-xs);
}

/* Modal Buttons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: var(--spacing-sm);
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 217, 255, 0.3);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

/* Status Messages */
.status-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.status-message.info {
    background: rgba(0, 217, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.status-message.success {
    background: rgba(105, 240, 174, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(255, 61, 113, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .auth-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }

    .auth-card {
        padding: var(--spacing-lg);
        min-height: 480px;
    }
}

@media (max-width: 968px) {
    .auth-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .auth-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        padding: var(--spacing-lg) var(--spacing-sm);
        gap: var(--spacing-xl);
    }

    .hero-logo {
        width: 80px;
        height: 80px;
        margin-bottom: var(--spacing-md);
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero-stats {
        gap: var(--spacing-xs);
        flex-wrap: nowrap;
    }

    .stat-pill {
        font-size: 0.7rem;
        padding: var(--spacing-xs) var(--spacing-sm);
        white-space: nowrap;
    }

    .auth-header h2 {
        font-size: 1.25rem;
    }

    .auth-card-unified {
        border-radius: var(--radius-xl);
        padding: var(--spacing-lg);
    }

    .method-switcher {
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }

    .method-tab {
        padding: var(--spacing-md);
        font-size: 1rem;
        gap: var(--spacing-xs);
    }

    .method-tab span {
        font-size: 2.2rem;
    }

    .method-description h3 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .method-description p {
        font-size: 1.15rem;
        line-height: 1.5;
    }

    .auth-method-content {
        min-height: 310px;
    }

    .form-group-compact input {
        padding: var(--spacing-md);
        font-size: 1.1rem;
    }

    .btn-auth {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: 1.1rem;
    }

    .btn-icon {
        font-size: 1.4rem;
    }

    .auth-status {
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: var(--spacing-lg);
        max-height: 95vh;
    }

    .user-info {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .user-info #userName {
        font-size: 0.85rem;
    }

    .btn-logout {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero-logo {
        width: 64px;
        height: 64px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .stat-pill {
        font-size: 0.95rem;
    }

    .auth-header h2 {
        font-size: 1.1rem;
    }

    .auth-container {
        padding: var(--spacing-lg) var(--spacing-xs);
    }

    .auth-card-unified {
        padding: var(--spacing-md);
    }

    .method-tab {
        padding: var(--spacing-md);
        font-size: 0.85rem;
    }

    .method-tab span {
        font-size: 1.4rem;
    }
}