﻿/* ==========================================================================
   App Theme - design tokens and shared components
   Used by: Nav/Login.aspx, Nav/Home.Master and its content pages.
   All names use the "ds-" prefix so they never clash with tsapprreg.css,
   Dashboard.css or Bootstrap.

   Palette rule: one brand colour (indigo #1a237e) + neutrals. Nothing else.
   ========================================================================== */

:root {
    /* Colour */
    --ds-primary: #1a237e;
    --ds-primary-hover: #141b62;
    --ds-primary-soft: #eceef7;
    --ds-bg: #f4f6f9;
    --ds-surface: #ffffff;
    --ds-border: #e2e7ee;
    --ds-border-strong: #c9d1dc;
    --ds-text: #172033;
    --ds-text-muted: #5a6577;
    --ds-text-subtle: #8a94a5;
    --ds-overlay: rgba(23, 32, 51, 0.45);

    /* Brand surface - login header, portal sidebar - and the text that sits on it */
    --ds-brand-bg: #1a237e;
    --ds-on-brand: #ffffff;
    --ds-on-brand-muted: rgba(255, 255, 255, 0.78);
    --ds-on-brand-subtle: rgba(255, 255, 255, 0.55);
    --ds-on-brand-border: rgba(255, 255, 255, 0.12);
    --ds-on-brand-hover: rgba(255, 255, 255, 0.08);
    --ds-on-brand-active: rgba(255, 255, 255, 0.14);
    --ds-on-brand-focus: 0 0 0 2px rgba(255, 255, 255, 0.6);

    /* Typography */
    --ds-font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ds-text-xs: 0.75rem;    /* 12px */
    --ds-text-sm: 0.875rem;   /* 14px */
    --ds-text-base: 0.9375rem; /* 15px */
    --ds-text-md: 1rem;       /* 16px */
    --ds-text-lg: 1.125rem;   /* 18px */
    --ds-text-xl: 1.5rem;     /* 24px */

    /* Spacing (4px scale) */
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 24px;
    --ds-space-6: 32px;
    --ds-space-7: 48px;

    /* Shape & depth */
    --ds-radius-sm: 6px;
    --ds-radius-md: 10px;
    --ds-radius-full: 999px;
    --ds-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --ds-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);
    --ds-focus: 0 0 0 3px rgba(26, 35, 126, 0.22);
    --ds-transition: 150ms ease;

    /* Controls */
    --ds-control-height: 44px;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.ds-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-sm);
}

/* --------------------------------------------------------------------------
   Buttons  (work on <button>, <a> and asp:Button / <input type="submit">)
   -------------------------------------------------------------------------- */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    height: var(--ds-control-height);
    padding: 0 var(--ds-space-5);
    font-family: var(--ds-font);
    font-size: var(--ds-text-base);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-sm);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color var(--ds-transition), border-color var(--ds-transition), box-shadow var(--ds-transition);
}

    .ds-btn:focus-visible {
        outline: none;
        box-shadow: var(--ds-focus);
    }

    .ds-btn:disabled,
    .ds-btn.aspNetDisabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.ds-btn--primary {
    background: var(--ds-primary);
    color: #fff;
}

    .ds-btn--primary:hover,
    .ds-btn--primary:active {
        background: var(--ds-primary-hover);
        color: #fff;
    }

.ds-btn--secondary {
    background: var(--ds-surface);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}

    .ds-btn--secondary:hover {
        background: var(--ds-bg);
        color: var(--ds-text);
    }

.ds-btn--block {
    display: flex;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Form fields
   .ds-input-group = input with a leading icon (.ds-input-icon)
   -------------------------------------------------------------------------- */
.ds-field {
    margin-bottom: var(--ds-space-4);
}

.ds-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--ds-text-sm);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.4;
}

.ds-input {
    display: block;
    width: 100%;
    height: var(--ds-control-height);
    padding: 0 14px;
    font-family: var(--ds-font);
    font-size: var(--ds-text-base);
    color: var(--ds-text);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border-strong);
    border-radius: var(--ds-radius-sm);
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
}

    .ds-input::placeholder {
        color: var(--ds-text-subtle);
        opacity: 1;
    }

    .ds-input:focus {
        outline: none;
        border-color: var(--ds-primary);
        box-shadow: var(--ds-focus);
    }

.ds-input-group {
    position: relative;
}

    .ds-input-group .ds-input {
        padding-left: 42px;
    }

.ds-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    transform: translateY(-50%);
    font-size: var(--ds-text-base);
    text-align: center;
    color: var(--ds-text-subtle);
    pointer-events: none;
    transition: color var(--ds-transition);
}

.ds-input-group:focus-within .ds-input-icon {
    color: var(--ds-primary);
}

.ds-hint {
    display: block;
    margin-top: 6px;
    font-size: var(--ds-text-xs);
    color: var(--ds-text-muted);
    line-height: 1.5;
    text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
.ds-link {
    color: var(--ds-primary);
    font-weight: 600;
    text-decoration: none;
}

    .ds-link:hover {
        color: var(--ds-primary-hover);
        text-decoration: underline;
    }

    .ds-link:focus-visible {
        outline: none;
        border-radius: 2px;
        box-shadow: var(--ds-focus);
    }
