/*
Copyright 2019 Square Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap');

*, *::before, *::after {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: none;
}

:root{
    /* Berry's brand palette and semantic design tokens */
    --mauve: #B997A3;
    --slate: #456574;
    --wine-plum: #6E3F59;
    --warm-cream: #F5F0EC;
    --mushroom: #B7ACA4;
    --primary: var(--slate);
    --secondary: var(--mushroom);
    --accent: var(--wine-plum);
    --reward-accent: var(--wine-plum);
    --app-background: var(--mauve);
    --ink: var(--slate);
    --surface: var(--warm-cream);
    --surface-soft: var(--warm-cream);
    --secondary-surface: var(--warm-cream);
    --accent-soft: var(--warm-cream);
    --reward-soft: var(--warm-cream);
    --border-color: var(--mushroom);
    --muted-icon: var(--slate);
    --business-name-color: var(--primary);
    --overlay-color: rgba(69, 101, 116, 0.76);
    --box-shadow: 0 8px 24px rgba(69, 101, 116, 0.16), 0 2px 6px rgba(69, 101, 116, 0.09);
    --green: var(--primary);
    --dark-gray: var(--ink);
    --neutral-gray: var(--slate);
    --light-gray: var(--mushroom);
    --placeholder-gray: var(--slate);
    --background-color: var(--app-background);
    --white: var(--surface);
    --warning: var(--accent-soft);
    --success: var(--warm-cream);
    --font-heading: 'Poppins', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
    color: var(--placeholder-gray);
}
::-moz-placeholder { /* Firefox 19+ */
    color:var(--placeholder-gray);
}
::-ms-input-placeholder { /* IE 10+ */
    color: var(--placeholder-gray);
}
::-moz-placeholder { /* Firefox 18- */
    color: var(--placeholder-gray);
}

::-moz-selection {
    background: var(--accent-soft);
    text-shadow: none;
}

::selection {
    background: var(--accent-soft);
    text-shadow: none;
}

.green {
    color:var(--green);
}

.subtext{
    color: var(--placeholder-gray);
}

.helperText {
    color: var(--neutral-gray);
    font-size: 12px;
    line-height: 20px;
}

a {
    color:inherit;
    text-decoration: none;
    -webkit-transition: all .2s ease-in-out;
       -moz-transition: all .2s ease-in-out;
        -ms-transition: all .2s ease-in-out;
            transition: all .2s ease-in-out;
}

audio,
canvas,
iframe,
img,
svg,
video {
    vertical-align: middle;
    font-size: 10px;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

html, body {
    color: var(--dark-gray);
    font-size: 16px;
    line-height: 28px;
    font-family: var(--font-body);
    font-weight: 400;
    margin: 0;
    padding: 0;
}
html { max-width: 100%; overflow-x: hidden; }
body { max-width: 100%; overflow-x: clip; }
main, section, article, nav, form, fieldset { min-width: 0; }
img, svg, video, canvas { max-width: 100%; }

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1em 0;
    padding: 0;
}

button {
    border: 0;
    border-radius: var(--radius-sm);
    background-color:var(--green);
    line-height: 28px;
    padding: 14px 24px;
    font-weight: 700;
    font-size: 16px;
    color: var(--surface);
    text-decoration: none;
    font-family: var(--font-heading);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(69, 101, 116, .22);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

html.modal-open, body.modal-open { overflow: hidden; overscroll-behavior: none; }

h1, h2, h3, h4, h5 {
    color: var(--primary);
    font-family: var(--font-heading);
    font-weight: 700;
    margin: 1em auto 0 auto;
}

h1 {
    color: var(--accent);
    font-size: 32px;
    line-height: 40px;
    /* margin-bottom: 24px; */
}

h2 {
    font-size: 24px;
    line-height: 32px;
    margin-bottom: 16px;
}

h3 {
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 8px;
}

h4 {
    font-size: 16px;
    line-height: 28px;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

h5 {
    font-size: 16px;
    line-height: 28px;
    margin-bottom: 0px;
}

.page-title {
    color: var(--accent);
    text-align: center;
    margin: 8px auto 40px;
    height: 32px;
    left: 372px;
    top: 112px;
    font-size: 24px;
    line-height: 32px;
}

.container {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
}

.left { float: left; }
.right { float: right; }

.tabular-figures {
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum";
    -moz-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
    font-size: 24px;
}
.tabular-figures.negative {
    margin-right: -5px;
}

.cocoon {
    min-height: 100vh;
    width: 100%;
    padding: 0 24px 40px;
    position: relative;
    box-sizing: border-box;
    background: var(--app-background);
}

html, body { background: var(--app-background); }
body { min-width: 320px; }
p { margin: .6rem 0 1rem; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(69, 101, 116, .5);
    outline-offset: 3px;
}
button:hover:not(:disabled), .form-button:hover, .button-link:hover, .primary-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(69, 101, 116, .26);
}
input, select, textarea {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69, 101, 116, .3); }
.safe-note, .form-errors, .error-message { border-color: var(--accent) !important; color: var(--ink) !important; }
.status-pill, .bears-balance { color: var(--accent) !important; }
.form-button, .button-link, .primary-action { background: var(--primary); color: var(--surface); }
.organization-footer{display:grid;gap:.45rem;width:min(100%,1100px);box-sizing:border-box;margin:2.5rem auto 0;padding:1.1rem 1.25rem;border-top:1px solid var(--border-color);color:var(--ink);font-size:.9rem;line-height:1.45;text-align:center}.organization-footer strong{font-family:var(--font-heading);font-size:1rem}.organization-footer address{display:flex;flex-wrap:wrap;gap:.35rem 1rem;justify-content:center;font-style:normal}.organization-footer nav{display:flex;flex-wrap:wrap;gap:.45rem 1rem;justify-content:center}.organization-footer a{text-decoration:underline;text-underline-offset:3px}

@media (max-width: 700px) {
    .cocoon { padding: 0 clamp(10px, 3.2vw, 16px) calc(92px + env(safe-area-inset-bottom)); }
    h1 { font-size: 1.75rem; line-height: 1.2; }
    h2 { font-size: 1.35rem; line-height: 1.3; }
    button, .form-button { min-height: 48px; }
    .page-title { height: auto; margin: 4px auto 24px; }
    .organization-footer{margin-top:1.75rem;padding-inline:.75rem}.organization-footer address,.organization-footer nav{flex-direction:column;align-items:center}
}

/* Shared compact action layout used by Home and narrow app surfaces. */
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; }
.quick-links a { display: flex; min-height: 48px; align-items: center; justify-content: center;
    padding: .65rem 1rem; border-radius: var(--radius-sm); line-height: 1.3; text-align: center; }
@media (max-width: 650px) {
    .home-page { padding-inline: 0; }
    .home-page .hero-card { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
    .home-page .hero-placeholder { min-height: 120px; }
    .home-page .deal-card { align-items: stretch; gap: .75rem; margin: 1rem 0 1.75rem; padding: 1rem; }
    .home-page .deal-link, .home-page .hero-card .button-link { display: flex; width: 100%; min-height: 48px;
        box-sizing: border-box; align-items: center; justify-content: center; text-align: center; }
    .home-page .home-section { margin: 1.75rem 0; }
    .home-page .feature-grid, .home-page .quick-links { grid-template-columns: 1fr; }
    .home-page .feature-card { padding: 1rem; margin: .5rem 0; }
}

/*
 * Hide visually and from screen readers
 */
 .hidden {
    display: none;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

/* .clearfix:before, */
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}
