:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --secondary: #c9a227;
    --border: #e2e8f0;
    --light: #f7fafc;
    --dark: #1a202c;
    --gray: #718096;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    line-height: 1.5;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #1a365d 100%);
    min-height: 100vh;
    margin: 0;
}

/* ── Container ─────────────────────────────────────────────── */
.signup-container {
    background: white;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    max-width: 560px;
    width: 100%;
}

/* ── Header ─────────────────────────────────────────────────── */
.signup-header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.signup-header img {
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.signup-header-text h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.signup-header-text p {
    font-size: 0.72rem;
    margin: 0;
    opacity: 0.75;
}

.logo-link { display: inline-block; }

/* ── Body ───────────────────────────────────────────────────── */
.signup-body {
    padding: 1.1rem 1.5rem 1rem;
}

/* ── Account type toggle ───────────────────────────────────── */
.account-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 0.85rem;
    gap: 3px;
}

.account-toggle-btn {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

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

.account-toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ── Form elements ─────────────────────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: 0.73rem;
    color: #475569;
    margin-bottom: 0.2rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control, .form-select {
    border-radius: 7px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--dark);
    height: auto;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.12);
    outline: none;
}

.form-control::placeholder { color: #94a3b8; font-size: 0.83rem; }

.mb-field { margin-bottom: 0.6rem; }

/* ── Account type toggle (Law Firm / Corporate) ───────────── */
.account-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.3rem;
    background: #f1f5f9;
    border-radius: 9px;
    border: 1px solid var(--border);
}

.account-type-toggle .at-option {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--gray);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.6rem;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.account-type-toggle .at-option i { font-size: 0.95rem; }

.account-type-toggle .at-option:hover {
    background: rgba(255,255,255,0.6);
    color: var(--primary);
}

.account-type-toggle .at-option.active {
    background: #fff;
    color: var(--primary);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.row { --bs-gutter-x: 0.75rem; }

/* ── Input group (password eye) ───────────────────────────── */
.input-group .form-control { border-radius: 7px 0 0 7px; }

.input-group-text {
    border-radius: 0 7px 7px 0;
    border-left: none;
    background: var(--light);
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    color: var(--gray);
    border-color: var(--border);
}

.input-group-text:hover { background: #e2e8f0; }

/* ── Password requirements ─────────────────────────────────── */
.password-requirements {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    font-size: 0.7rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.password-requirements.show { display: block; }

.password-requirements p {
    font-size: 0.68rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #475569;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
}

.password-requirements li {
    padding: 0.1rem 0;
    font-size: 0.67rem;
    color: #94a3b8;
}

.password-requirements li::before { content: '✗ '; color: #ef4444; }
.password-requirements li.valid { color: #10b981; }
.password-requirements li.valid::before { content: '✓ '; color: #10b981; }

/* ── Helper / form-text ─────────────────────────────────────── */
.form-text, .hint-text {
    font-size: 0.67rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    line-height: 1.3;
}

/* ── Terms checkbox ─────────────────────────────────────────── */
.form-check {
    padding-left: 1.35rem;
    margin-bottom: 0;
}

.form-check-input {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.15rem;
    cursor: pointer;
}

.form-check-label {
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1.4;
}

.form-check-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-check-label a:hover { text-decoration: underline; }

/* ── CAPTCHA inline layout ─────────────────────────────────── */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.captcha-question {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    background: #f0f4ff;
    border: 1px solid #c7d7fa;
    border-radius: 7px;
    padding: 0.45rem 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.captcha-row .form-control {
    width: 80px;
    flex-shrink: 0;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Refresh button */
.captcha-refresh-btn {
    border: 1px solid var(--border);
    background: white;
    border-radius: 7px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.captcha-refresh-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f4ff;
}

.captcha-refresh-btn.spinning i {
    display: inline-block;
    animation: spin 0.5s linear;
}

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

/* Error state */
.captcha-error {
    font-size: 0.67rem;
    color: #dc2626;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

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

.captcha-row .form-control.is-wrong {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.captcha-question.refreshing {
    background: #fff8e1;
    border-color: #fbbf24;
    color: #92400e;
}

/* ── Submit button ─────────────────────────────────────────── */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
    cursor: pointer;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 54, 93, 0.25);
    color: white;
}

.btn-primary-custom:disabled { opacity: 0.75; transform: none; box-shadow: none; cursor: not-allowed; }

/* ── Footer link ────────────────────────────────────────────── */
.signup-footer {
    text-align: center;
    padding: 0.65rem 1.5rem 0.85rem;
    font-size: 0.78rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}

.signup-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.signup-footer a:hover { text-decoration: underline; }

/* ── Section divider ────────────────────────────────────────── */
.section-divider {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.6rem 0 0.5rem;
}

.section-divider::before, .section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 576px) {
    .signup-container { border-radius: 0; min-height: 100vh; }
    .signup-body { padding: 1rem; }
    .signup-header { padding: 0.85rem 1rem; }
    .captcha-row { flex-wrap: wrap; }
    .password-requirements ul { columns: 1; }
}
