/* -------------------------------------------------------
   shadcn/ui-inspired theme on top of Bootstrap 5
   Uses Inter font, neutral zinc palette, sharp-soft radius
------------------------------------------------------- */

/* --- CSS custom properties (shadcn design tokens) ------ */
:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Neutral zinc palette */
    --background: #F8F8F8;
    --foreground: #09090b;
    --card: #ffffff;
    --card-foreground: #09090b;
    --popover: #ffffff;
    --popover-foreground: #09090b;
    --primary: #015A8D;
    --primary-foreground: #fafafa;
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --accent: #f4f4f5;
    --accent-foreground: #18181b;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #18181b;
    --radius: 0.5rem;
    /* Bootstrap variable overrides */
    --bs-font-sans-serif: var(--font-sans);
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--foreground);
    --bs-body-bg: var(--background);
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: calc(var(--radius) - 0.125rem);
    --bs-border-radius-lg: calc(var(--radius) + 0.125rem);
}

/* --- Base ----------------------------------------------- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    /* Hard-coded fallback alongside the variable so the font always applies
       regardless of when the variable resolves relative to Bootstrap's cascade */
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    margin-bottom: 60px;
    letter-spacing: -0.01em;
}

/* --- Typography ----------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

/* --- Card ----------------------------------------------- */
.card {
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.card-body {
    padding: 1.5rem;
}

.p20-card-dropshadow {
    box-shadow:
        0 4px 6px -1px rgb(0 0 0 / 0.08),
        0 2px 4px -2px rgb(0 0 0 / 0.06);
}

/* --- Form controls -------------------------------------- */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    background-color: var(--background);
    color: var(--foreground);
    border: 1px solid #e4e4e7; /* hard-coded fallback + variable */
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
}

.form-control:hover,
.form-select:hover {
    border-color: #a1a1aa;
}

.form-control:focus,
.form-select:focus {
    border-color: #18181b;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgb(24 24 27 / 0.12);
    outline: none;
    background-color: var(--background);
}

.form-control[readonly] {
    background-color: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
}

.form-check-input {
    border: 1px solid #e4e4e7;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 0.25rem);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 2px rgb(24 24 27 / 0.12);
}

/* --- Buttons -------------------------------------------- */
.btn {
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    letter-spacing: 0em;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    box-shadow: none !important;
}

.btn-primary {
    background-color: #18181b;
    background-color: var(--primary);
    border-color: #18181b;
    border-color: var(--primary);
    color: #fafafa;
    color: var(--primary-foreground);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #27272a;
    border-color: #27272a;
    color: var(--primary-foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #e4e4e7;
    border-color: #e4e4e7;
    color: var(--secondary-foreground);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--border);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--border);
}

.btn-danger {
    background-color: var(--destructive);
    border-color: var(--destructive);
    color: var(--destructive-foreground);
}

.btn-lg {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border-radius: var(--radius);
}

/* --- Alerts --------------------------------------------- */
.alert {
    border-radius: var(--radius);
    font-size: 0.875rem;
    border-width: 1px;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* --- Validation ----------------------------------------- */
.text-danger,
.field-validation-error {
    font-size: 0.8125rem;
    color: #ef4444 !important;
    color: var(--destructive) !important;
}

/* --- Footer --------------------------------------------- */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    border-color: var(--border) !important;
}

.footer a {
    color: var(--muted-foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Navbar logo --------------------------------------- */
.navbar-logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border: 0;
}

/* --- Page-level container ------------------------------ */
/*.p20-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top:2rem;
}*/

.privacy-policy-link {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

    .privacy-policy-link:hover {
        color: var(--foreground);
    }

/* --- Forgot Password Link ------------------------------ */
.forgot-password-link {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
    text-align: right;
}

    .forgot-password-link:hover {
        color: var(--foreground);
        text-decoration: underline;
    }