/* =========================================================
   Coastal Port – UI theme to match Coastal Studios site
   Palette + components aligned with the landing page you sent.
   Drop-in file: /port/styles.css (or similar). Link it on all Port pages.
   ========================================================= */

/* --- Theme tokens --- */
:root {
    /* Brand */
    --ocean: #0197B2;
    /* Ocean Blue */
    --teal: #41B1C5;
    /* Teal Blue */
    --light: #80CAD7;
    /* Light Blue */
    --soft: #1C1C1C;
    /* Soft Black */
    --white: #fff;
    --muted: #5a6b72;
    --bg: #f7fbfc;
    /* Page bg */

    /* Effects */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --border: 1px solid rgba(1, 151, 178, .12);
    --shadow: 0 10px 30px rgba(1, 151, 178, .15);
    --shadow-lg: 0 14px 34px rgba(1, 151, 178, .22);
}

/* --- Base / Typography --- */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Roboto', system-ui, -apple-system, Segoe UI, sans-serif;
    color: var(--soft);
    background: linear-gradient(180deg, #ffffff 0%, #f9feff 50%, #f3fcff 100%);
}

img {
    max-width: 100%;
    display: block
}

a {
    color: inherit;
    text-decoration: none
}

.container {
    width: min(1200px, 92%);
    margin-inline: auto
}

.small {
    font-size: .9rem;
    color: var(--muted)
}

.muted {
    color: var(--muted)
}

/* Focus */
:where(a, button, [role="button"], input, select, textarea):focus {
    outline: 3px solid color-mix(in oklab, var(--ocean) 50%, white);
    outline-offset: 2px;
    border-radius: 8px
}

/* --- Header / Nav --- */
header.site {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255, 255, 255, .75);
    border-bottom: var(--border);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0
}

.brand {
    display: flex;
    align-items: center;
    gap: .7rem
}

.brand img {
    height: 38px;
    width: auto
}

.brand-title {
    font-weight: 800;
    letter-spacing: .2px
}

nav.primary ul {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center
}

nav.primary a {
    padding: .6rem .9rem;
    border-radius: 10px;
    font-weight: 600
}

nav.primary a:hover {
    background: rgba(1, 151, 178, .08)
}

/* Mobile nav */
.menu-toggle {
    display: none
}

.menu-panel {
    display: none
}

@media (max-width: 820px) {
    nav.primary ul {
        display: none
    }

    .menu-toggle {
        display: inline-flex;
        padding: .6rem .8rem;
        border-radius: 10px;
        border: 1px solid rgba(0, 0, 0, .06)
    }

    .menu-panel {
        position: fixed;
        inset: 60px 0 auto 0;
        background: #fff;
        border-top: 1px solid rgba(0, 0, 0, .06);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
        display: none
    }

    .menu-panel.open {
        display: block
    }

    .menu-panel .container {
        display: grid;
        gap: .5rem;
        padding: 1rem
    }

    .menu-panel a {
        padding: 1rem;
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(1, 151, 178, .05), transparent);
        font-weight: 600
    }
}

/* --- Buttons / Pills --- */
.btn {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    padding: .6rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(1, 151, 178, .16);
    background: #fff;
    cursor: pointer
}

.btn:hover {
    background: rgba(1, 151, 178, .06)
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed
}

.cta {
    background: linear-gradient(135deg, var(--ocean), var(--teal));
    color: var(--white);
    border: none;
    padding: .7rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer
}

.cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg)
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .02em;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: rgba(1, 151, 178, .1);
    color: var(--ocean)
}

/* --- Cards & Surfaces --- */
.card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden
}

.card-body {
    padding: 1rem
}

.card-media {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(1, 151, 178, .2), rgba(128, 202, 215, .2));
    display: grid;
    place-items: center
}

.card h3 {
    margin: .2rem 0;
    font-size: 1.1rem
}

.card p {
    margin: .3rem 0;
    color: var(--muted)
}

.btn-row {
    display: flex;
    gap: .5rem;
    padding: 0 1rem 1rem
}

/* --- Product grid (keeps your existing class names) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-left: 5rem;
    padding-right: 5rem
}

.product-card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.product-image {
    aspect-ratio: 16/9;
    object-fit: cover
}

.product-info {
    padding: 1rem;
    display: grid;
    gap: .5rem
}

.price-button,
.download-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .6rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(1, 151, 178, .16);
    background: #fff
}

.price-button:hover,
.download-button:hover {
    background: rgba(1, 151, 178, .06)
}

/* Chips */
.chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .4rem
}

.chip {
    font-size: .75rem;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: rgba(1, 151, 178, .08);
    color: var(--ocean);
    font-weight: 700
}

/* --- Tables (admin lists, orders, purchases) --- */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden
}

.table th,
.table td {
    padding: .9rem .9rem;
    text-align: left
}

.table thead th {
    background: linear-gradient(180deg, rgba(1, 151, 178, .06), rgba(1, 151, 178, .02));
    color: var(--soft);
    font-weight: 800
}

.table tbody tr+tr td {
    border-top: 1px solid rgba(1, 151, 178, .12)
}

.table .pill {
    background: rgba(1, 151, 178, .1)
}

/* --- Forms --- */
.input,
.select,
.textarea {
    width: 100%;
    padding: .8rem .9rem;
    border-radius: 10px;
    border: 1px solid rgba(1, 151, 178, .25);
    background: #fff;
    color: var(--soft)
}

.label {
    font-weight: 600;
    color: var(--soft)
}

.form-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr
}

@media (max-width:760px) {
    .form-row {
        grid-template-columns: 1fr
    }
}

/* --- Admin shells (keeps your old class names but light) --- */
.admin-wrap {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
}

.admin-card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 20px;
}

.admin-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
}

.admin-input,
.admin-select,
.admin-file,
.admin-checkbox {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(1, 151, 178, .25);
    background: #fff;
    color: var(--soft);
}

.admin-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-btn {
    background: #fff;
    color: var(--soft);
    border: 1px solid rgba(1, 151, 178, .25);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.admin-btn:hover {
    background: rgba(1, 151, 178, .06);
}

.admin-danger {
    background: linear-gradient(135deg, #b20101, #d94343);
    color: #fff;
    border: none;
}

.admin-danger:hover {
    filter: brightness(.95)
}

.flash {
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(31, 122, 31, .12), rgba(31, 122, 31, .06));
    color: #1f5a20;
    margin-bottom: 12px;
    display: inline-block;
    border: 1px solid rgba(31, 122, 31, .2)
}

.errors {
    background: linear-gradient(180deg, rgba(178, 1, 1, .12), rgba(178, 1, 1, .06));
    color: #5a2020;
    border: 1px solid rgba(178, 1, 1, .2);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.errors li {
    margin-left: 18px
}

/* --- Error page (light) --- */
.error-page {
    display: grid;
    place-items: center;
    min-height: 85vh;
    background: var(--bg);
    text-align: center;
}

.error-container {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 420px;
}

.error-logo {
    width: 75px;
    margin-bottom: 10px
}

.error-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--soft);
    font-weight: 800
}

.error-message {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--muted)
}

/* --- Login page (convert your overlay to brand-matched panel) --- */
.login-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 420px 1fr;
}

.login-panel {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(8px);
    border-right: var(--border);
    display: grid;
    align-content: center;
    padding: 2rem;
}

.login-panel .title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 .25rem
}

.login-panel .sub {
    color: var(--muted);
    margin: 0 0 1.25rem
}

.login-actions {
    display: grid;
    gap: .6rem
}

.login-btn {
    background: linear-gradient(135deg, var(--ocean), var(--teal));
    color: #fff;
    padding: .8rem 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow)
}

.login-btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px)
}

.login-help {
    color: color-mix(in oklab, var(--ocean) 65%, black);
    font-weight: 700
}

.login-hero {
    background: url('Images/background.png') center/cover no-repeat;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr
    }

    .login-hero {
        display: none
    }
}

/* --- Sections (if the hub has intro blocks) --- */
section {
    padding: clamp(1.2rem, 4vw, 2rem) 0
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.6vw, 2rem)
}

.section-head p {
    margin: 0;
    color: var(--muted)
}

/* --- Utility layout helpers --- */
.grid {
    display: grid;
    gap: 1rem
}

.cols-2 {
    grid-template-columns: 1fr 1fr
}

.cols-3 {
    grid-template-columns: repeat(3, 1fr)
}

@media (max-width: 960px) {
    .cols-3 {
        grid-template-columns: 1fr 1fr
    }
}

@media (max-width: 640px) {
    .cols-3 {
        grid-template-columns: 1fr
    }
}

/* --- Optional: dark-mode opt-in via a class (not auto) --- */
.theme-dark {
    --bg: #0e1214;
    --soft: #f5f7f8;
    --white: #101416;
    --muted: #9fb0b7;
}

.theme-dark body {
    background: linear-gradient(180deg, #0f1416 0%, #0d1214 50%, #0b1012 100%)
}

.theme-dark .card,
.theme-dark .admin-card,
.theme-dark .error-container {
    background: #11171a;
    border: 1px solid rgba(255, 255, 255, .08)
}

.theme-dark .btn,
.theme-dark .admin-btn {
    background: #121a1e;
    border-color: rgba(255, 255, 255, .08);
    color: #f5f7f8
}

.theme-dark .btn:hover,
.theme-dark .admin-btn:hover {
    background: #0f171b
}

.theme-dark .table {
    background: #11171a;
    border-color: rgba(255, 255, 255, .08)
}

.theme-dark .table tbody tr+tr td {
    border-top: 1px solid rgba(255, 255, 255, .08)
}

.theme-dark .input,
.theme-dark .select,
.theme-dark .textarea,
.theme-dark .admin-input {
    background: #0f1518;
    border-color: rgba(255, 255, 255, .12);
    color: #f5f7f8
}

.theme-dark .error-page {
    background: #0e1214
}

/* --- Motion safety --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}

        footer {
            margin-top: 2rem;
            background: #fff;
            border-top: 1px solid rgba(1, 151, 178, .12)
        }
    
        .footer-inner {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            gap: 2rem;
            padding: 2rem 0
        }
    
        .footer-inner p {
            color: var(--muted)
        }
    
        .small {
            font-size: .85rem;
            color: var(--muted)
        }
    
        @media (max-width: 800px) {
            .footer-inner {
                grid-template-columns: 1fr
            }
        }