/* 4th Co. shared look — every page on the shopper and operator sides loads this
   first. Colors, type, buttons, inputs, the top/bottom bars and cards live here
   only; qrshopapp/style.css and operators/operators.css add page-specific bits. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
:root{
    --bg:#232224;
    --bg-rgb:35,34,36;
    --text:#e5e5e5;
    --text-rgb:255,255,255;
    --brand-slate:#454447;
    --brand-slate-rgb:69,68,71;
    --blue:#a9e0de;
    --blue-rgb:169,224,222;
    --red:#dda8a8;
    --red-rgb:221,168,168;
}

/* Padding counts inside width; long strings wrap instead of overflowing. */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    overflow-wrap:break-word;
    word-wrap:break-word;
}

body{
    font-family:'Montserrat',sans-serif;
    font-size:16px;
    line-height:1.5;
    color:var(--text);
    background:var(--bg);
    overflow-x:hidden;
}

h1{font-size:2rem;font-weight:700;line-height:1.2;}
h2{font-size:1.5rem;font-weight:600;line-height:1.2;}
h3{font-size:1.25rem;font-weight:600;line-height:1.2;}
h4{font-size:1rem;font-weight:600;}
p{font-size:1rem;font-weight:400;}
label{font-size:0.875rem;font-weight:500;}
small{font-size:0.75rem;font-weight:400;}

img{
    max-width:100%;
    height:auto;
}
/* Fixed top bar; variable height holds the logo plus an optional search box. */
.navbar{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    padding:12px 16px;
    background:var(--brand-slate);
    border-bottom:1px solid var(--text);
    z-index:1450;
    box-shadow:0 12px 24px -6px rgba(var(--brand-slate-rgb),0.6);
}
.logo img{
    height:clamp(30px,6vh,70px);
    width:auto;
    display:block;
}

.logo span{
    font-size:2rem;
    font-weight:300;
}

/* Fixed bottom bar mirrors the navbar; children spread by width. */
.bottom-bar{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    height:clamp(60px,10vh,100px);
    display:flex;
    align-items:center;
    justify-content:space-around;
    padding:12px 16px;
    background:var(--brand-slate);
    border-top:1px solid var(--text);
    z-index:500;
}

/* Content fades out just above the bottom bar so it's clear the page scrolls under it.
   On every page that has a bottom bar, shopper and operator alike. */
.bottom-bar::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:100%;
    height:48px;
    background:linear-gradient(to bottom,rgba(var(--bg-rgb),0),var(--bg));
    pointer-events:none;
}

.bottom-bar img{
    flex:1;
    max-width:30%;
    height:auto;
    cursor:pointer;
}

/* Centered column shell, cleared above the navbar and below the bottom bar. */
.page{
    width:100%;
    max-width:480px;
    margin:0 auto;
    padding:24px;
    padding-top:calc(clamp(60px,10vh,100px) + 24px);
    padding-bottom:calc(clamp(60px,10vh,100px) + 56px);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:16px;
    text-align:center;
    overflow-wrap:break-word;
    word-break:break-word;
}

button{
    width:100%;
    min-height:52px;
    font-family:inherit;
    font-size:1rem;
    font-weight:600;
    border:none;
    border-radius:0;
    background:var(--text);
    color:var(--bg);
    cursor:pointer;
    touch-action:manipulation;
}

input{
    width:100%;
    height:48px;
    font-family:inherit;
    font-size:1rem;
    padding:0 16px;
    color:var(--text);
    background:transparent;
    border:1px solid var(--text);
    border-radius:0;
}

input::placeholder{
    color:rgba(var(--text-rgb),0.6);
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
    gap:20px;
}

.field{
    display:flex;
    flex-direction:column;
    gap:6px;
}

/* Reusable slate panel with defined edges. */
.card{
    background:var(--brand-slate);
    border:1px solid var(--text);
    box-shadow:0 24px 36px -6px rgba(var(--brand-slate-rgb),0.6);
    padding:24px;
    width:100%;
    max-width:400px;
    margin:0 auto;
    border-radius:0;
}
.message-box{
    position:fixed;
    bottom:24px;
    left:50%;
    transform:translateX(-50%);
    width:90%;
    max-width:400px;
    background:var(--text);
    color:var(--bg);
    padding:12px 24px;
    border-radius:0;
    z-index:1000;
    text-align:center;
    overflow-wrap:break-word;
    word-break:break-word;
}
.back-link{
    display:flex;
    align-items:center;
    justify-content:center;
    height:100%;
    text-decoration:none;
}

.back-link img{
    height:90%;
    width:auto;
    max-width:none;
    cursor:pointer;
}
.login-intro,
.page-intro{
    margin-bottom:8px;
}

.email-error,
.error{
    color:var(--red);
    font-size:0.875rem;
}

.email-error{
    margin-top:8px;
}

/* Small "lost your login details? contact 4th Co." line under a sign-in form. */
.forgot-link{
    margin-top:16px;
    text-align:center;
    font-size:0.875rem;
}

/* Inputs light up blue when focused, like the Stripe payment fields. */
input:focus{
    outline:none;
    border-color:var(--blue);
}

.page button:disabled{
    opacity:0.5;
    cursor:not-allowed;
}

/* The global input rule makes every input full width; tick boxes stay small. */
input[type="radio"],
input[type="checkbox"]{
    width:20px;
    height:20px;
    flex-shrink:0;
    padding:0;
    accent-color:var(--blue);
    cursor:pointer;
}

.page a{
    color:var(--blue);
}

/* Link that looks and sizes like a button. Blue = continue, red = stop/back. */
.page a.btn{
    width:100%;
    min-height:52px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 16px;
    font-weight:600;
    text-decoration:none;
    background:var(--text);
    color:var(--bg);
}

.page a.btn-blue{
    background:var(--blue);
}

.page a.btn-red{
    background:var(--red);
}

/* Status panels: red for problems, blue for "in progress / all good". */
.notice{
    width:100%;
    padding:16px;
    border:1px solid var(--text);
    background:var(--brand-slate);
    box-shadow:0 24px 36px -6px rgba(var(--brand-slate-rgb),0.6);
    display:flex;
    flex-direction:column;
    gap:8px;
}

.notice-title{
    font-weight:600;
}

.notice-red{
    border-color:var(--red);
}

.notice-red .notice-title{
    color:var(--red);
}

.notice-blue{
    border-color:var(--blue);
}

.notice-blue .notice-title{
    color:var(--blue);
}

/* Section heading for multi-part pages (Choose Term, Locations, ...). The large
   top margin gives every section clear breathing room on any page that uses it. */
.section-title{
    width:100%;
    text-align:center;
    margin-top:56px;
    padding-bottom:8px;
    border-bottom:1px solid rgba(var(--text-rgb),0.2);
}

/* Small grey helper line under a section heading. */
.field-help{
    width:100%;
    text-align:center;
    font-size:0.875rem;
    color:rgba(var(--text-rgb),0.7);
}

/* Item search, shared by the shopper scanner and operator item pages: a box in the
   navbar and a results panel that drops down under it. */
#searchBox{
    width:100%;
    max-width:400px;
    height:40px;
    font-family:inherit;
    font-size:1rem;
    padding:0 16px;
    color:var(--text);
    background:transparent;
    border:1px solid var(--text);
    border-radius:0;
}

#searchClose{
    background:var(--red);
    color:var(--bg);
    border:none;
}

#searchModal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(var(--bg-rgb),0.7);
    align-items:flex-start;
    justify-content:center;
    z-index:1400;
    padding:var(--navbar-height,120px) 0 0 0;
}

#searchModal.active{
    display:flex;
}

#searchModalInner{
    background:var(--bg);
    border:1px solid var(--text);
    box-shadow:0 24px 36px -6px rgba(var(--brand-slate-rgb),0.6);
    width:100%;
    max-width:none;
    max-height:70vh;
    overflow-y:auto;
    padding:16px;
}

#searchClose{
    margin-bottom:2.5vh;
}

.search-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:16px;
    border-bottom:1px solid var(--brand-slate);
}

.search-row:last-child{
    border-bottom:none;
}

.search-row-info{
    text-align:left;
}

.search-row-name{
    font-weight:600;
}

.search-row-price{
    font-size:0.875rem;
}

.search-add-btn{
    width:auto;
    min-height:auto;
    padding:8px 16px;
    flex-shrink:0;
}

.search-empty{
    padding:16px;
    text-align:center;
}

/* ---------------------------------------------------------------------------------------------
   4th Co. Button Shape — Rounded Top-Left Corner, Angled Cut Bottom-Right, the Same as the
   Marketing Site. --b-r Is the Round Corner, --b-c the Cut. Small Buttons Set Smaller Values.
   Solid Buttons Glow Softly Inside on Hover (Like the Dashboard Tiles) and Press in a Touch.
   Outline Buttons Draw Their Border Back Along the Cut With an ::after Line (operators.css).
   --------------------------------------------------------------------------------------------- */
button,
.page a.btn,
.btn-disabled{
    --b-r:22px;
    --b-c:14px;
    position:relative;
    border-top-left-radius:var(--b-r);
    clip-path:polygon(0 0,100% 0,100% calc(100% - var(--b-c)),calc(100% - var(--b-c)) 100%,0 100%);
    transition:background 0.15s,box-shadow 0.15s,transform 0.05s;
}

button:hover:not(:disabled),
.page a.btn:not(.btn-outline):hover{
    box-shadow:inset 0 0 16px rgba(255,255,255,0.55);
}

button:active:not(:disabled),
.page a.btn:active{
    transform:scale(0.98);
}

/* The Shape Clips a Normal Focus Ring, So Keyboard Focus Draws an Inner Ring Instead */
button:focus-visible,
.page a.btn:focus-visible{
    outline:none;
    box-shadow:inset 0 0 0 2px var(--bg),inset 0 0 0 4px var(--blue);
}
