/* ============================================================
   AUTH — login, register, twofa, verify_email
   ============================================================ */

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 3rem auto;
    padding: 0 1rem;
    animation: authFadeIn 0.4s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card {
    background: rgba(18, 24, 32, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(76, 175, 80, 0.15);
}

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

.auth-card .logo a {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4CAF50, #81c784);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: #8a92b0;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e0e0;
}

.input-wrapper {
    position: relative;
}

.input-wrapper > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a92b0;
    font-size: 1rem;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(26, 31, 46, 1);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.input-wrapper input.error {
    border-color: #f44336;
}

.input-wrapper input::placeholder { color: #555c75; }

/* Code input (2FA) */
.input-wrapper input.code-input {
    text-align: center;
    letter-spacing: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    padding-left: 1rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8a92b0;
    transition: color 0.2s;
}

.password-toggle:hover { color: #4CAF50; }

.error-message {
    color: #f44336;
    font-size: 0.7rem;
    margin-top: 0.3rem;
    display: none;
}

.error-message.show { display: block; }

/* Password requirements */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.7rem;
}

.req {
    color: #8a92b0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s;
}

.req i {
    font-size: 0.5rem;
}

.req.valid { color: #4CAF50; }

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #4CAF50;
    flex-shrink: 0;
}

.checkbox-group label {
    color: #b0b8d0;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-group a {
    color: #4CAF50;
    text-decoration: none;
}

.checkbox-group a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn-auth {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 0.5rem;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}

.btn-auth:disabled,
.btn-auth.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-auth.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* ---------- Links ---------- */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #8a92b0;
    font-size: 0.9rem;
}

.auth-link a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
}

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

.auth-back {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-back a {
    color: #8a92b0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.auth-back a:hover { color: #4CAF50; }

.forgot-link {
    text-align: right;
    margin: -0.5rem 0 1.5rem 0;
}

.forgot-link a {
    color: #8a92b0;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link a:hover { color: #4CAF50; }

/* ---------- Alert ---------- */
.alert {
    padding: 0.9rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: none;
    text-align: center;
    line-height: 1.4;
}

.alert.show { display: block; }

.alert.error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff8a80;
}

.alert.success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #b9f6ca;
}

.alert.warn {
    background: rgba(255, 170, 0, 0.15);
    border: 1px solid rgba(255, 170, 0, 0.3);
    color: #ffaa00;
}

/* ---------- Turnstile ---------- */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

/* ---------- Hint ---------- */
.auth-hint {
    font-size: 0.7rem;
    color: #8a92b0;
    margin-top: 0.5rem;
    text-align: center;
}

/* ---------- Email icon (verify) ---------- */
.verify-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 24px;
}

.verify-email {
    color: #fff;
    font-weight: 600;
}

@media (max-width: 480px) {
    .auth-container { margin: 1rem auto; }
    .auth-card { padding: 1.5rem; }
    .auth-title { font-size: 1.5rem; }
}