/* Auth pages — aligned with settings / user-management modal design */
:root {
    --primary: #00d4aa;
    --primary-dark: #00a888;
    --bg-dark: #0a0f19;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo h1 {
    color: var(--text);
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 0.45rem;
    letter-spacing: 0.01em;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.35rem 1.25rem 1.5rem;
}

.tabs {
    display: flex;
    margin-bottom: 1.15rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.tab {
    flex: 1;
    padding: 0.65rem 0.5rem;
    text-align: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 9px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tab.active {
    background: rgba(0, 212, 170, 0.14);
    color: var(--primary);
    border-color: rgba(0, 212, 170, 0.35);
}

.tab:hover:not(.active) {
    color: var(--text);
}

.form {
    display: none;
}

.form.active {
    display: block;
}

.auth-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.05rem 1.1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.95rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
    font-size: 0.85rem;
}

[dir="rtl"] .input-wrapper i {
    right: 0.85rem;
    left: auto;
}

[dir="ltr"] .input-wrapper i {
    left: 0.85rem;
    right: auto;
}

.form-group input,
.choice-section .input-field,
.modal-content .input-field {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0;
}

[dir="rtl"] .form-group input {
    padding-right: 2.45rem;
    padding-left: 0.9rem;
    text-align: right;
}

[dir="ltr"] .form-group input {
    padding-left: 2.45rem;
    padding-right: 0.9rem;
    text-align: left;
}

.form-group input:focus,
.choice-section .input-field:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.55);
    background: rgba(0, 0, 0, 0.38);
}

.form-group input::placeholder,
.choice-section .input-field::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}

.form-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 0.35rem;
    line-height: 1.4;
}

.btn {
    width: 100%;
    padding: 0.72rem 1rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-primary {
    background: rgba(0, 212, 170, 0.2);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.45);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(0, 212, 170, 0.3);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-google {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border: 1px solid var(--border);
}

.btn-google:hover {
    background: #fff;
}

.btn-resend {
    background: rgba(0, 212, 170, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.4);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 0.75rem;
}

.signup-toggle {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0;
}

.toggle-btn {
    flex: 1;
    padding: 0.55rem 0.4rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    line-height: 1.25;
}

.toggle-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
}

.toggle-btn.active {
    border-color: rgba(0, 212, 170, 0.45);
    background: rgba(0, 212, 170, 0.12);
    color: var(--primary);
}

.toggle-btn i {
    font-size: 0.75rem;
}

#newTeamFields,
#inviteCodeFields {
    margin-top: 0.85rem;
}

.forgot-password {
    text-align: center;
    margin-top: 0.85rem;
}

.forgot-password a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.forgot-password a:hover {
    color: var(--primary);
}

.status {
    margin-top: 0.85rem;
    padding: 0.85rem;
    border-radius: 10px;
    text-align: center;
    display: none;
    font-size: 0.88rem;
    line-height: 1.45;
}

.status.success {
    display: block;
    background: rgba(0, 212, 170, 0.12);
    border: 1px solid rgba(0, 212, 170, 0.35);
    color: var(--primary);
}

.status.error {
    display: block;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.spam-notice {
    margin-top: 0.85rem;
    padding: 0.7rem 0.8rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 10px;
    text-align: center;
}

.spam-notice small {
    color: #fcd34d;
    font-size: 0.8rem;
    line-height: 1.4;
}

.back-link {
    text-align: center;
    margin-top: 1.25rem;
}

.back-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
}

.back-link a:hover {
    color: var(--primary);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Google team choice modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.35rem 1.25rem 1.5rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    line-height: 1;
    border-radius: 8px;
}

[dir="rtl"] .modal-close {
    left: 0.85rem;
    right: auto;
}

[dir="ltr"] .modal-close {
    right: 0.85rem;
    left: auto;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.modal-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.choice-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.05rem;
    margin-bottom: 0;
}

.choice-section h3 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.choice-section h3 i {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.choice-section p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.choice-section .form-group {
    margin: 0.75rem 0;
}

.choice-divider {
    display: flex;
    align-items: center;
    margin: 0.85rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.choice-divider::before,
.choice-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.choice-divider span {
    padding: 0 0.65rem;
}

.lang-select {
    position: fixed;
    top: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

[dir="rtl"] .lang-select {
    left: 1rem;
}

[dir="ltr"] .lang-select {
    right: 1rem;
}

.lang-select option {
    background: var(--bg-dark);
    color: var(--text);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.15rem 1rem 1.25rem;
    }

    .logo h1 {
        font-size: 1.45rem;
    }

    .signup-toggle {
        flex-direction: column;
    }

    .toggle-btn {
        font-size: 0.82rem;
    }
}
