/* ============================================================
   Log-in screen
   Two-column grid layout, mobile-first responsive
   ============================================================ */


/* --- Tokens --- */
:root {
    --navy:       #1a2b4a;
    --blue:       #00B0DB;   /* KCPL accent you were already using */
    --blue-dark:  #0090b8;
    --red:        #c8392b;
    --light:      #f4f6f8;
    --border:     #dde2e8;
    --text:       #222;
    --muted:      #666;
    --white:      #fff;
    --radius:     6px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: var(--white);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- Page wrapper keeps footer at bottom --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.site-header {
    background-color: var(--navy);
    padding: 14px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    height: 250px;
}

.site-header .header-logo {
    height: auto;
    width: 100%;
    max-width: 860px;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.site-header h1 {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
}

/* --- Main card --- */
main.card {
    flex: 1;
    background: var(--white);

    margin: 32px auto;
    padding: 36px 40px;
    width: 100%;
    max-width: 860px;       /* wide enough for two columns */
}

main.card h2 {
    color: var(--navy);
    font-size: 1.3rem;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

/* --- Error message --- */
.error {
    background: #fdf0ef;
    border-left: 4px solid var(--red);
    color: #7a1f18;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .9rem;
}

/* ============================================================
   THE GRID
   Desktop: 2 columns  |  left fields  |  book cover  |
   Mobile:  1 column, cover moves below the fields
   ============================================================ */
.form-grid {
    display: grid;

    /*
       Left column = 1fr (takes available space)
       Right column = 220px (fixed cover width)
       Change 220px to suit your cover image size
    */
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto; /* one per field row + submit */
    column-gap: 32px;
    row-gap: 0;             /* fields control their own spacing with margin-bottom */

    grid-template-areas:
        "name"
        "pin"
        "submit"
}

/* --- Left-column fields --- */
.field {
    margin-bottom: 20px;    /* vertical spacing between fields */
}

.number-field  { grid-area: name; }
.password-field  { grid-area: pin; }


/*
   The "Other" box sits in its own row so it doesn't
   push the cover image down when it appears.
   display:none is set inline by default; JS switches it to block.
*/
.other-field { grid-area: other; margin-bottom: 0; }

/* --- Labels --- */
label {
    display: block;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

/* --- Inputs and select --- */

input[type="text"],
input[type="password"],
select {
    width: 50%;
    padding: 10px 12px;
    margin: 8px 0 6px;
    border: 1px solid #949494;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}


/* --- Submit button - spans full width --- */
.submit-btn {
    grid-area: submit;
    display: block;
    width: 100%;             /* 50% of the card as requested */
    margin: 28px auto 0;    /* centred */
    padding: 13px;
    background-color: var(--blue);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    letter-spacing: .5px;
    transition: background-color .2s, opacity .2s;
}

.submit-btn:hover {
    background-color: var(--blue-dark);
}

/* --- Footer --- */
.site-footer {
    background-color: var(--navy);
    color: #aab4c4;
    text-align: center;
    padding: 16px;
    font-size: .8rem;
}

.site-footer a {
    color: #aab4c4;
    text-decoration: none;
}

.site-footer a:hover { color: var(--white); }

/* ============================================================
   MOBILE - collapses to single column below 600px
   ============================================================ */
@media (max-width: 600px) {
    main.card {
        margin: 12px;
        padding: 24px 16px;
    }

    input[type="text"],
    input[type="password"] {
        width: 100%;
    }

    .form-grid {
        /*
           Single column on mobile.
           Cover moves below the title dropdown naturally
           because it's last in the grid-template-areas flow.
        */
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "pin"
            "submit";
    }

    .submit-btn {
        width: 100%;        /* full width on small screens */
    }
}
