:root {
    --focus-ring: rgba(58, 123, 213, 0.35);
    --sketch-color: #1F3A5F;
}

body {
    color: #132033;
}

.bg-paper {
    background-color: #fff;
    background-image:
            radial-gradient(rgba(19, 32, 51, 0.035) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* Subtle sketch lines overlay */
.sketch-lines {
    position: relative;
}

.sketch-lines::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06; /* tune: 0.03–0.10 */
    mix-blend-mode: multiply; /* keeps it ink-like */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%231F3A5F' stroke-opacity='0.9' stroke-width='1'%3E%3Cpath d='M-10 38 C 40 28, 80 48, 140 36 S 240 28, 270 40'/%3E%3Cpath d='M-20 92 C 30 78, 90 110, 150 90 S 230 70, 280 98'/%3E%3Cpath d='M-15 150 C 55 130, 105 172, 165 152 S 235 132, 275 160'/%3E%3Cpath d='M-10 210 C 60 192, 110 232, 170 212 S 240 190, 275 220'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 260px 260px;
    border-radius: inherit;
}

.border-sketch {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(31, 58, 95, 0.40);
}

.border-sketch::after {
    content: "";
    position: absolute;
    inset: 2px;                 /* slight offset inward */
    border-radius: inherit;
    border: 1px solid rgba(31, 58, 95, 0.20);
    pointer-events: none;
}

.card-sketch {
    background: #fff;
    border: 2px solid rgba(31, 58, 95, 0.45);
    border-radius: 14px;
    box-shadow: 1px 1px 0 rgba(31, 58, 95, 0.14);
}



*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

/* ==========================================================================
   Paper + Sketch Design Language
   ========================================================================== */

/* App background - subtle warm paper with light texture */
.bg-paper {
    background-color: #FDFCFA;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(255, 253, 250, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, #FDFCFA 0%, #FAF9F7 100%);
}

/* Default card/panel border - hand-drawn sketch style */
.border-sketch {
    border: 1.5px solid var(--sketch-color);
    border-radius: 3px;
    box-shadow:
        2px 2px 0 0 rgba(31, 58, 95, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Special/user-facing card - sketch style with subtle fill */
.card-sketch {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFD 100%);
    border: 1.5px solid var(--sketch-color);
    border-radius: 4px;
    box-shadow:
        3px 3px 0 0 rgba(31, 58, 95, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Graph paper background for diagram/canvas areas */
.bg-graph {
    background-color: #FDFCFB;
    background-image:
        linear-gradient(rgba(31, 58, 95, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 58, 95, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Sketch lines overlay - use with opacity utilities */
.sketch-lines {
    position: relative;
}

.sketch-lines::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 23px,
            rgba(31, 58, 95, 0.04) 23px,
            rgba(31, 58, 95, 0.04) 24px
        );
    border-radius: inherit;
}

/* Sketch lines with stronger opacity for emphasis */
.sketch-lines-strong::before {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 23px,
            rgba(31, 58, 95, 0.06) 23px,
            rgba(31, 58, 95, 0.06) 24px
        );
}

/* ==========================================================================
   Index Card
   ========================================================================== */
.index-card {
    background-color: #FFFEF9;
    border-top: 4px solid #3A7BD5;
    border-radius: 6px;
    box-shadow:
        2px 3px 0 0 rgba(31, 58, 95, 0.10),
        4px 5px 0 0 rgba(31, 58, 95, 0.05);
    padding: 1.5rem;
    position: relative;
}

/* Ruled lines */
.index-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 27px,
            rgba(31, 58, 95, 0.06) 27px,
            rgba(31, 58, 95, 0.06) 28px
        );
}

/* Index card title - sits in the blue top strip */
.index-card-title {
    background-color: #3A7BD5;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 1rem;
    margin: -1.5rem -1.5rem 1.25rem;
    border-radius: 2px 2px 0 0;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Form Utilities
   ========================================================================== */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-500, #6b7280);
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-surface-0, #fff);
    border: 1px solid var(--color-border-1, #e5e7eb);
    border-radius: 2px;
    font-size: 0.875rem;
    color: var(--color-text-900, #111827);
}

.form-input::placeholder {
    color: var(--color-text-500, #6b7280);
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-help {
    font-size: 0.6875rem;
    line-height: 1.3;
    color: var(--color-text-500, #6b7280);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Results Card
   ========================================================================== */
.results-card {
    background-color: var(--color-surface-0, #fff);
    border: 1.5px solid var(--sketch-color);
    border-radius: 3px;
    padding: 1rem;
    box-shadow:
        2px 2px 0 0 rgba(31, 58, 95, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.results-card-title {
    font-weight: 600;
    color: var(--color-brand-navy-900, #1F3A5F);
    margin-bottom: 0.75rem;
}

/* Paper texture noise */
.index-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.025;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}
