/* style.css – CET324 Assignment 2 – Secure Registration System */

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

:root {
    --clr-bg:         #f1f5f9;
    --clr-card:       #ffffff;
    --clr-primary:    #1e40af;
    --clr-primary-h:  #1d4ed8;
    --clr-border:     #cbd5e1;
    --clr-text:       #1e293b;
    --clr-muted:      #64748b;
    --clr-error:      #dc2626;
    --clr-success:    #16a34a;
    --radius:         0.5rem;
    --shadow:         0 4px 24px rgba(0,0,0,0.08);
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.9375rem;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: var(--clr-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 460px;
    padding: 2.25rem 2rem;
}

.card-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-primary);
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--clr-muted);
    font-size: 0.875rem;
}

/* ── Form elements ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: var(--clr-text);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--clr-text);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12);
    background: #fff;
}

input.is-invalid {
    border-color: var(--clr-error);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

/* ── Password strength bar ─────────────────────────────────── */
.strength-bar-wrap {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width 0.35s ease, background-color 0.35s ease;
    background: #dc2626;
}

.strength-label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.3rem;
    color: var(--clr-muted);
}

.strength-feedback {
    list-style: none;
    margin-top: 0.5rem;
    padding: 0;
}

.strength-feedback li {
    font-size: 0.8rem;
    color: var(--clr-muted);
    padding: 0.125rem 0;
}

.strength-feedback li::before {
    content: '• ';
    color: var(--clr-error);
}

/* ── CAPTCHA ───────────────────────────────────────────────── */
.captcha-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.captcha-wrap img {
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius);
    cursor: pointer;
    display: block;
}

.captcha-wrap button[type="button"] {
    background: none;
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--clr-muted);
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.captcha-wrap button[type="button"]:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--clr-error);
}

.alert-error ul {
    margin: 0.25rem 0 0 1rem;
}

.alert-error li {
    margin: 0.15rem 0;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--clr-success);
}

.field-error {
    color: var(--clr-error);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* ── Submit button ─────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--clr-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    background: var(--clr-primary-h);
}

.btn-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Security badge ────────────────────────────────────────── */
.security-note {
    text-align: center;
    color: var(--clr-muted);
    font-size: 0.78rem;
    margin-top: 1.25rem;
}

.security-note span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── Success page ──────────────────────────────────────────── */
.success-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--clr-success);
}

.success-list {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.success-list li {
    font-size: 0.875rem;
    color: #166534;
    margin: 0.2rem 0 0.2rem 1rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 500px) {
    .card {
        padding: 1.5rem 1.25rem;
    }
}
