﻿/**
 * Auth Modal Popup Styles
 */

#auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

#auth-modal.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.auth-modal-content {
    position: relative;
    z-index: 2;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 1px rgba(3, 199, 90, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #13667a;
    letter-spacing: 0.5px;
}

/* Tabs */
.auth-modal-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid #2a2a2a;
    background: #131313;
}

.auth-modal-tab {
    flex: 1;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-modal-tab svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.auth-modal-tab:hover {
    border-color: #13667a;
    color: #13667a;
}

.auth-modal-tab.active {
    background: #13667a;
    border-color: #13667a;
    color: #000;
}

/* Forms */
.auth-modal-form-wrapper {
    display: none;
    padding: 24px;
}

.auth-modal-form-wrapper.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-input {
    padding: 12px 14px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #13667a;
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.12);
}

.form-input::placeholder {
    color: #555;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    flex: 1;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #13667a;
}

/* Password Strength */
.password-strength-bar {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease;
}

.password-strength-bar.show {
    max-height: 10px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 30%;
    background: #13667a;
}

.strength-fill.medium {
    width: 65%;
    background: #ffb800;
}

.strength-fill.strong {
    width: 100%;
    background: #13667a;
}

.password-strength-text {
    font-size: 12px;
    font-weight: 600;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.password-strength-text.show {
    max-height: 20px;
}

/* Checkbox */
.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #13667a;
}

.checkbox-group label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
    user-select: none;
}

/* Errors */
.form-error {
    font-size: 12px;
    color: #13667a;
}

.modal-error-message {
    background: #13667a1a;
    border: 1px solid #13667a;
    color: #13667a;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
    animation: slideInError 0.2s ease;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #13667a;
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    background: #e13f44;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.25);
}

.btn-primary:active:not(:disabled) {
    background: #c4353b;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-text.hidden {
    opacity: 0;
    width: 0;
    display: none;
}

.btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Discord OAuth button */
.btn-discord {
    background: #5865F2;
    color: #fff;
    gap: 10px;
}

.btn-discord:hover:not(:disabled) {
    background: #4752c4;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

.btn-discord:active:not(:disabled) {
    background: #3c45a5;
}

.btn-discord:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Divider between form and social buttons */
.auth-social-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
    color: #555;
    font-size: 12px;
}

.auth-social-divider::before,
.auth-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2a2a2a;
}

/* Links */
.form-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.form-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.form-links a svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.link-forgot {
    font-size: 12px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-forgot:hover {
    color: #13667a;
    text-decoration: underline;
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
}

.form-footer p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.form-footer a {
    color: #13667a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.form-footer a:hover {
    color: #e13f44;
    text-decoration: underline;
}

/* Cloudflare Turnstile */
.cf-turnstile {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65px;
}

.cf-turnstile iframe {
    border-radius: 6px;
}

/* Notifications */
.modal-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInNotification 0.3s ease;
}

.notification-success {
    background: #13667a;
    color: #000;
}

.notification-error {
    background: #13667a;
    color: #fff;
}

.notification-info {
    background: #1677ff;
    color: #fff;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutNotification {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-modal-content {
        width: 95%;
        max-width: none;
        max-height: 85vh;
    }

    .auth-modal-header {
        padding: 16px 16px 12px;
    }

    .auth-modal-title {
        font-size: 20px;
    }

    .auth-modal-tabs {
        padding: 12px 16px;
        gap: 6px;
    }

    .auth-modal-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .auth-modal-form-wrapper {
        padding: 16px;
    }

    .form-input {
        padding: 11px 12px;
        font-size: 13px;
    }

    .toggle-password {
        right: 10px;
        font-size: 16px;
    }

    .btn {
        padding: 11px 14px;
        font-size: 13px;
    }

    .modal-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Scrollbar */
.auth-modal-content::-webkit-scrollbar {
    width: 6px;
}

.auth-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.auth-modal-content::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}

.auth-modal-content::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}
