/* ============================================================
   Auth Pages — register / forgetPwd / modifyPwd
   Shared layout & component styles.
   Requires: crm-theme.css
   ============================================================ */

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

body.auth-page {
    font-family: var(--font-base);
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ── Card ── */
.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 44px 44px 40px;
    width: 100%;
    max-width: 480px;
}

.auth-card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 32px;
}

/* ── Back link ── */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}
.auth-back:hover { color: var(--brand-primary); }
.auth-back svg { flex-shrink: 0; }

/* ── Form field ── */
.auth-field {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-label);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-input);
    font-size: var(--font-size-base);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: var(--color-placeholder); }
.auth-input:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.12);
    background: #fff;
}

/* ── Select (language) ── */
.auth-select {
    width: 100%;
    padding: 11px 36px 11px 14px;
    background: var(--color-input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-input);
    font-size: var(--font-size-base);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-select:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.12);
    background-color: #fff;
}

/* ── Helper text ── */
.auth-helper {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 5px;
}

/* ── Code row: input + send button ── */
.auth-code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.auth-code-row .auth-input { flex: 1; min-width: 0; }

.auth-send-btn {
    flex-shrink: 0;
    padding: 11px 16px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
    border-radius: var(--radius-btn);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.auth-send-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.auth-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Password strength ── */
.auth-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.auth-strength-bar {
    flex: 1;
    height: 3px;
    background: var(--color-border);
    border-radius: 2px;
    transition: background 0.3s;
}
.auth-strength-bar.weak   { background: #EF4444; }
.auth-strength-bar.medium { background: #F59E0B; }
.auth-strength-bar.strong { background: #10B981; }

/* ── Primary button ── */
.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--brand-primary);
    color: #fff;
    font-size: var(--font-size-md);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: var(--shadow-btn);
    display: block;
    text-align: center;
    text-decoration: none;
}
.auth-btn:hover {
    background: var(--brand-primary-dark);
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
    color: #fff;
}
.auth-btn:active { transform: translateY(0); box-shadow: none; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Footer link ── */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.auth-footer a {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
}
.auth-footer a:hover { color: var(--color-link-hover); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 520px) {
    .auth-card { padding: 32px 20px 28px; }
    .auth-card-title { font-size: var(--font-size-lg); margin-bottom: 24px; }
}
