/* =====================================================================
   IZU - styles
   ---------------------------------------------------------------------
   The visual language deliberately mirrors the rest of the project: light
   grey page background, green gradient header, white cards, form "tester"
   panels, and green action buttons.

   Only the classes that are specific to the pairing flow (QR code plate,
   manual-entry key, and warning box) are additions on top of that shared
   look.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Base theme
   --------------------------------------------------------------------- */

/* Force the light palette; the shared project styles are light-only. */
:root { color-scheme: light; }

/* Smooth scrolling for any future in-page links. */
html { scroll-behavior: smooth; }

/* Include padding and borders in every element's width. */
* { box-sizing: border-box; }

/* Page typography, background and text colour, matching the project. */
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #cbcbcb;
    color: #1f2d27;
    line-height: 1.5;
}

/* Standard project link colours. */
a { color: #157347; }
a:hover { color: #0f5c38; }

/* ---------------------------------------------------------------------
   Header (same green gradient band and logo treatment as the project)
   --------------------------------------------------------------------- */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #37b661, #93d4b4);
    border-bottom: 1px solid #cfdcd5;
}

/* The text column may shrink so the logo keeps its fixed size. */
.header-text { min-width: 0; }

/* Logo is a fixed square and never stretches. */
.logo {
    display: block;
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* Header title and supporting sentence. */
header h1 { margin: 0 0 .25rem; font-size: 1.8rem; }
header p { margin: 0; color: #5b6f65; max-width: 75ch; }

/* ---------------------------------------------------------------------
   Page layout
   --------------------------------------------------------------------- */

/* Wide, centred content area, exactly like the shared console page. */
main {
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Breathing room between logical sections. */
section { margin-bottom: 2.5rem; }

/* Section headings use the shared thin green rule. */
h2 {
    border-bottom: 1px solid #cfdcd5;
    padding-bottom: .4rem;
    font-size: 1.2rem;
}

/* Panel/card titles are small and tight, as in the shared project styles. */
h3 { margin: 0 0 .3rem; font-size: 1rem; }

/* ---------------------------------------------------------------------
   Result cards (one per person)
   --------------------------------------------------------------------- */

/* Responsive grid of white cards. */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

/* One person's card. */
.card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #d4e0d9;
    border-radius: 10px;
    padding: 1rem;
}

/* Muted explanatory text inside the cards. */
.card p { color: #5b6f65; font-size: .9rem; }

/* Keep the QR plate centred under the card text. */
.card .qr { align-self: center; margin-top: .25rem; }

/* ---------------------------------------------------------------------
   Form / tester panels
   --------------------------------------------------------------------- */

/* Grey panel that groups related fields and actions, matching .tester. */
.tester {
    background: #eaeaea;
    border: 1px solid #d4e0d9;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Responsive field grid used for the two name inputs. */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: .75rem;
}

/* Stacked label + field, using the shared muted label colour. */
label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    font-size: .8rem;
    color: #5b6f65;
}

/* Inputs match the shared console styling. */
input, select {
    background: #ffffff;
    border: 1px solid #b9c9c0;
    color: #1f2d27;
    border-radius: 6px;
    padding: .45rem .55rem;
    font-size: .9rem;
    width: 100%;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

/* Primary green action button, identical to the shared console. */
button {
    background: #1f7a48;
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    padding: .5rem .9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Slightly darker green on hover. */
button:hover { background: #16663b; }

/* Secondary action: outlined green instead of filled. */
button.ghost {
    background: transparent;
    color: #1f7a48;
    border: 1px solid #1f7a48;
}

/* Tinted background for the secondary button on hover. */
button.ghost:hover { background: #e8f2ec; color: #16663b; }

/* Accessible, on-brand focus ring for keyboard users. */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #1f7a48;
    outline-offset: 2px;
}

/* Row containing the generate/clear buttons. */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ---------------------------------------------------------------------
   Manual-entry key
   --------------------------------------------------------------------- */

/* Result-like panel used for the type-in secret. */
.result {
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: .75rem;
    min-height: 2.5rem;
    max-height: 22rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .8rem;
    color: #14532d;
}

/* Muted helper sentence above the key. */
.muted { color: #6b7f75; font-size: .85rem; }

/* Space within the manual-entry tester panel. */
.key-box .muted { margin: .25rem 0 .5rem; }

/* The key itself: monospaced and letter-spaced for easier reading. */
.key-box .result {
    margin: 0;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: .04em;
}

/* ---------------------------------------------------------------------
   QR code plate
   --------------------------------------------------------------------- */

/* White plate keeps the code readable and matches the shared card border. */
.qr {
    display: inline-block;
    line-height: 0;
    background: #ffffff;
    border: 1px solid #d4e0d9;
    border-radius: 8px;
    padding: .5rem;
}

/* The generated SVG scales down on narrow screens but stays square. */
.qr svg {
    width: 240px;
    height: 240px;
    max-width: 100%;
}

/* ---------------------------------------------------------------------
   Security warning
   --------------------------------------------------------------------- */

/* Green-tinted panel that matches the project palette while remaining
   visually distinct thanks to the thicker left border. */
.warn {
    margin-top: 1rem;
    background: #f7faf8;
    border: 1px solid #d4e0d9;
    border-left: 4px solid #1f7a48;
    border-radius: 8px;
    padding: .75rem 1rem;
    color: #14532d;
    font-size: .9rem;
}

/* Compact spacing between the warning paragraphs. */
.warn p { margin: .4rem 0; }
.warn p:first-child { margin-top: 0; }
.warn p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   Results section visibility
   --------------------------------------------------------------------- */

/* The results stay hidden until the script has filled them in. */
#out { display: none; }
