/* Base: design tokens, page frame, buttons, cards, forms and badges. */

/* Design tokens ported from mastdata-next (src/app/globals.css) -- see the
   design-system research notes for the full extraction. This is the Portal's
   own pages (login, licence management, admin), not a page-by-page clone of
   the marketing site -- just consistent chrome and component language. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-red: #CD231B;
    --brand-red-dark: #A81C15;
    --brand-red-light: #E8342B;
    --dark: #0D1B2A;
    --dark-2: #12243A;
    --dark-3: #1A3049;
    --font-sans: 'Inter', system-ui, sans-serif;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-resting: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --container-max: 1280px;
}

* {
    box-sizing: border-box;
}

/* As mastdata.com: running text leading-relaxed (1.625), everything else 1.5. */
p {
    line-height: 1.625;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: #111827;
    background: #f1f4f8;
    line-height: 1.5;
    /* Sticky footer: main grows to fill the viewport, so the footer sits at
       the bottom on short pages instead of floating mid-screen. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--brand-red);
    text-decoration: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
    .container { padding: 0 2rem; }
}

/* Impersonation banner */
.impersonation-banner {
    background: var(--brand-red);
    color: #ffffff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.impersonation-banner__form {
    display: inline;
}

.impersonation-banner__link {
    background: none;
    border: none;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* Page content */
.page-content {
    padding-top: 3rem;
    padding-bottom: 3rem;
    flex: 1 0 auto;
    width: 100%;
}

.section-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-red);
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0.25rem 0 1.5rem;
}

@media (min-width: 768px) {
    .section-heading { font-size: 2.25rem; }
}

/* The title band: each page's title (and the map pages' tool links) on navy,
   right across the window under the nav. The border-image paints past the
   container without widening the page (it's ink overflow, not layout). */
.page-content:has(> .page-band:first-child) { padding-top: 0; }

.page-band {
    color: #ffffff;
    padding-top: 2.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.75rem;
    border-image: linear-gradient(var(--dark), var(--dark-2)) fill 0 / 0 / 0 100vmax;
}

.page-band .section-heading,
.page-band h1 { color: #ffffff; }
.page-band .section-label { color: #fca5a5; }
.page-band .section-heading { margin-bottom: 0; }

.page-band .btn-outline {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.page-band .btn-outline:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    border: 2px solid transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--brand-red);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--brand-red-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.btn-outline:hover {
    background: var(--brand-red);
    color: #ffffff;
}

.btn-secondary {
    background: transparent;
    border-color: #ffffff;
    color: #ffffff;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #dbe1e8;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
    padding: 2rem;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

/* Side-by-side fields (first/last name), stacking on narrow screens. */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    column-gap: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(205, 35, 27, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.validation-summary,
.text-danger {
    color: #dc2626;
    font-size: 0.875rem;
}

/* Status badges (licence management) */
.badge {
    display: inline-flex;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--role {
    background: #e0e7ff;
    color: #3730a3;
}

.badge--withdrawn {
    background: #f3f4f6;
    color: #6b7280;
}

.badge--ok {
    background: #dcfce7;
    color: #166534;
}

.badge--trial {
    background: #fef3c7;
    color: #92400e;
}

.badge--expired {
    background: #fee2e2;
    color: #991b1b;
}
