/* ── NCDRV Auth Pages Styles (Login & Register) ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --error: #dc2626;
    --success: #16a34a;
    --radius: 12px;
    --font: 'Inter', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[lang="ar"] body,
[lang="ar"] {
    --font: 'Tajawal', sans-serif;
    font-family: 'Tajawal', sans-serif;
}

/* ── Navbar ── */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo { font-size: 1.4rem; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--primary); }
.nav-right { display: flex; align-items: center; gap: 1rem; }

.btn-outline-sm {
    padding: .45rem 1.1rem; border: 1.5px solid var(--primary); color: var(--primary);
    border-radius: 8px; font-size: .875rem; font-weight: 500; text-decoration: none;
    transition: background .2s, color .2s;
}
.btn-outline-sm:hover { background: var(--primary); color: #fff; }

.btn-primary-sm {
    padding: .45rem 1.1rem; background: var(--primary); color: #fff;
    border-radius: 8px; font-size: .875rem; font-weight: 500; text-decoration: none;
    transition: background .2s;
}
.btn-primary-sm:hover { background: var(--primary-dark); }

/* ── Page wrapper ── */
.page {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    padding: 2rem 1rem;
}

.page--top {
    flex: 1; display: flex;
    align-items: flex-start; justify-content: center;
    padding: 2.5rem 1rem 4rem;
}

/* ── Card ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    width: 100%;
    padding: 2.5rem;
}
.card--sm { max-width: 440px; }
.card--lg { max-width: 760px; }

.card-header { text-align: center; margin-bottom: 2rem; }
.card-logo { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: .75rem; }
.card-logo span { color: var(--primary); }
.card-header h1 { font-size: 1.5rem; font-weight: 700; }
.card-header p  { color: var(--muted); margin-top: .35rem; font-size: .9rem; }

/* Register card header (no logo) */
.card-header--reg h1 { font-size: 1.75rem; font-weight: 700; }
.card-header--reg p  { color: var(--muted); margin-top: .4rem; font-size: .95rem; }

/* ── Section divider ── */
.section-title {
    display: flex; align-items: center; gap: .75rem;
    font-size: .8rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--primary);
    margin: 1.75rem 0 1.25rem;
}
.section-title::before, .section-title::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.col-span-2 { grid-column: span 2; }

/* ── Form elements ── */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.grid-2 .field { margin-bottom: 0; }

label { font-size: .875rem; font-weight: 500; }

input, select {
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .2s;
    width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }
input.is-invalid, select.is-invalid { border-color: var(--error); }
.field-error { font-size: .78rem; color: var(--error); }

.field-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: .35rem;
}
.field-row label { margin-bottom: 0; }
.forgot { font-size: .8rem; color: var(--primary); text-decoration: none; }
.forgot:hover { text-decoration: underline; }

/* ── Alert ── */
.alert {
    padding: .85rem 1rem; border-radius: 8px;
    font-size: .875rem; margin-bottom: 1.25rem;
}
.alert-error   { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ── Submit ── */
.btn-submit {
    width: 100%; padding: .85rem;
    background: var(--primary); color: #fff;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: .5rem;
    transition: background .2s;
    font-family: inherit;
}
.btn-submit--reg { margin-top: 1.75rem; }
.btn-submit:hover { background: var(--primary-dark); }

/* ── Footer link ── */
.form-footer { text-align: center; margin-top: 1.25rem; font-size: .875rem; color: var(--muted); }
.form-footer a { color: var(--primary); font-weight: 500; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .card { padding: 1.5rem 1.25rem; }
}

@media (max-width: 480px) {
    .card--sm { padding: 1.75rem 1.25rem; }
}
