/* =========================================================
   HUEMATCH - SMART OUTFIT COLOR ASSISTANT
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7fb;
    color: #1f2937;
    line-height: 1.5;
}

a {
    text-decoration: none;
}

button,
input {
    font: inherit;
}

:root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-soft: #f3f4f8;
    --sidebar: #151526;
    --primary: #6c63ff;
    --primary-dark: #5148e5;
    --primary-soft: #eeecff;
    --accent: #ff7ca8;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e2e5ec;
    --success: #3e9d6e;
    --warning: #c89028;
}


/* =========================================================
   LAYOUT
========================================================= */

.app-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 240px 1fr;
}

.app-sidebar {
    min-height: 100vh;

    background: var(--sidebar);

    padding: 26px 18px;

    display: flex;
    flex-direction: column;

    position: sticky;
    top: 0;
    align-self: start;
}

.app-main {
    min-width: 0;

    background: var(--bg);
}


/* =========================================================
   BRAND
========================================================= */

.app-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 7px 24px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: linear-gradient(135deg,
            var(--primary),
            var(--accent));

    color: #ffffff;

    font-size: 18px;
}

.app-brand>div:last-child {
    display: flex;
    flex-direction: column;
}

.app-brand-name {
    color: #ffffff;

    font-size: 18px;
    font-weight: 700;
}

.app-brand-subtitle {
    color: #9b9ab2;

    font-size: 9px;

    text-transform: uppercase;
    letter-spacing: 0.7px;
}


/* =========================================================
   NAV
========================================================= */

.app-nav {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin-top: 28px;
}

.app-nav a {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 11px 12px;

    border-radius: 9px;

    color: #c6c5d4;

    font-size: 13px;
    font-weight: 600;

    transition: 0.2s ease;
}

.app-nav a i {
    width: 18px;
}

.app-nav a:hover,
.app-nav a.active {
    background: rgba(108, 99, 255, 0.16);
    color: #ffffff;
}


/* =========================================================
   SIDEBAR NOTE
========================================================= */

.sidebar-note {
    margin-top: auto;

    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px;

    background: rgba(255, 255, 255, 0.06);

    border-radius: 10px;
}

.sidebar-note>i {
    color: #c7c3ff;

    margin-top: 3px;
}

.sidebar-note strong {
    display: block;

    color: #ffffff;

    font-size: 11px;
}

.sidebar-note span {
    color: #9290a6;

    font-size: 9px;
}


/* =========================================================
   HERO
========================================================= */

.app-hero {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;

    gap: 60px;

    align-items: center;

    padding: 70px 7%;

    min-height: 620px;

    background:
        radial-gradient(circle at 85% 20%,
            rgba(255, 124, 168, 0.14),
            transparent 30%),
        radial-gradient(circle at 70% 70%,
            rgba(108, 99, 255, 0.13),
            transparent 30%),
        #fbfbfe;
}

.eyebrow,
.section-label,
.card-label {
    color: var(--primary);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;

    margin-bottom: 10px;
}

.hero-copy h1 {
    max-width: 760px;

    font-size: 56px;
    line-height: 1.06;

    margin-bottom: 20px;
}

.hero-copy h1 span {
    display: block;

    color: var(--primary);
}

.hero-copy>p:last-of-type {
    max-width: 720px;

    color: var(--muted);

    font-size: 17px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: 30px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 12px 18px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 700;

    transition: 0.2s ease;
}

.primary-btn {
    background: var(--primary);
    color: #ffffff;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-btn {
    border: 1px solid var(--border);

    background: #ffffff;
    color: var(--text);
}

.secondary-btn:hover {
    border-color: #c6c2ff;
}


/* =========================================================
   PHONE PREVIEW
========================================================= */

.hero-phone-preview {
    display: flex;
    justify-content: center;
}

.phone-frame {
    width: 320px;

    padding: 18px;

    border: 10px solid #171725;
    border-radius: 34px;

    background: #ffffff;

    box-shadow:
        0 28px 60px rgba(39, 36, 90, 0.17);
}

.phone-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}

.phone-preview-card {
    padding: 18px;

    border-radius: 18px;

    background: #f6f5ff;

    text-align: center;
}

.phone-color-swatch {
    width: 88px;
    height: 88px;

    margin: 0 auto 12px;

    border-radius: 50%;

    background: #1F3A5F;

    box-shadow:
        inset 0 0 0 5px rgba(255, 255, 255, 0.45);
}

.preview-label {
    display: block;

    color: var(--muted);

    font-size: 9px;
}

.phone-preview-card strong {
    display: block;

    margin-top: 3px;

    font-size: 17px;
}

.phone-preview-card small {
    color: #7d8190;

    font-size: 10px;
}

.phone-match-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 7px;

    margin-top: 16px;
}

.phone-match-row span {
    height: 40px;

    border-radius: 10px;

    border: 1px solid rgba(0, 0, 0, 0.05);
}

.phone-tip {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin-top: 16px;

    padding: 12px;

    border-radius: 11px;

    background: #fff6e8;

    color: #6f5c3a;

    font-size: 10px;
    line-height: 1.5;
}


/* =========================================================
   SECTIONS
========================================================= */

.app-section {
    padding: 85px 7%;
}

.app-section-soft {
    background: #f0f1f7;
}

.section-heading {
    max-width: 760px;

    margin-bottom: 38px;
}

.section-heading h2 {
    font-size: 38px;

    margin-bottom: 12px;
}

.section-heading p:last-child {
    color: var(--muted);

    font-size: 15px;
}


/* =========================================================
   DETECTION
========================================================= */

.detect-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 24px;
}

.upload-card,
.color-result-card {
    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow:
        0 10px 26px rgba(31, 41, 55, 0.04);
}

.upload-card {
    text-align: center;
}

.upload-icon {
    width: 56px;
    height: 56px;

    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 20px;
}

.upload-card h3 {
    margin-bottom: 8px;

    font-size: 20px;
}

.upload-card>p {
    color: var(--muted);

    font-size: 13px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 18px;

    padding: 10px 15px;

    border-radius: 8px;

    background: var(--primary);
    color: #ffffff;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.image-preview-wrapper {
    display: none;

    margin-top: 20px;

    overflow: hidden;

    border-radius: 12px;

    border: 1px solid var(--border);
}

.image-preview-wrapper.show {
    display: block;
}

.image-preview-wrapper img {
    width: 100%;
    max-height: 300px;

    object-fit: cover;

    display: block;
}

.upload-note {
    margin-top: 16px !important;

    color: #9499a7 !important;

    font-size: 10px !important;
}


/* =========================================================
   DETECTED COLOR
========================================================= */

.detected-color-display {
    display: flex;
    align-items: center;

    gap: 18px;

    margin: 22px 0;
}

.detected-swatch {
    width: 90px;
    height: 90px;

    flex-shrink: 0;

    border-radius: 18px;

    background: #1F3A5F;

    box-shadow:
        inset 0 0 0 5px rgba(255, 255, 255, 0.35);
}

.detected-color-display span {
    color: var(--muted);

    font-size: 10px;
}

.detected-color-display h3 {
    margin: 3px 0;

    font-size: 24px;
}

.detected-color-display small {
    color: #8c92a0;
}

.color-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.color-details div {
    padding: 13px;

    background: #f8f8fb;

    border: 1px solid var(--border);
    border-radius: 9px;
}

.color-details span {
    display: block;

    color: var(--muted);

    font-size: 9px;

    margin-bottom: 4px;
}

.color-details strong {
    font-size: 11px;
}

.demo-color-picker {
    margin-top: 22px;
}

.demo-color-picker>span {
    display: block;

    margin-bottom: 10px;

    color: var(--muted);

    font-size: 10px;
}

.demo-color-options {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}

.demo-color-btn {
    width: 34px;
    height: 34px;

    border: 3px solid transparent;
    border-radius: 50%;

    cursor: pointer;

    transition: 0.2s ease;
}

.demo-color-btn.active {
    border-color: #ffffff;

    box-shadow:
        0 0 0 2px var(--primary);
}


/* =========================================================
   RECOMMENDATIONS
========================================================= */

.recommendation-layout {
    display: grid;
    grid-template-columns: 280px 1fr;

    gap: 25px;
}

.recommendation-summary {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #ffffff;

    align-self: start;
}

.summary-color {
    width: 58px;
    height: 58px;

    border-radius: 14px;

    background: #1F3A5F;
}

.recommendation-summary span {
    color: var(--muted);

    font-size: 10px;
}

.recommendation-summary h3 {
    margin-top: 3px;

    font-size: 17px;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.match-card {
    padding: 17px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 13px;
}

.match-swatch {
    height: 100px;

    border-radius: 10px;

    margin-bottom: 13px;
}

.match-card span {
    display: block;

    color: var(--muted);

    font-size: 9px;

    margin-bottom: 2px;
}

.match-card strong {
    display: block;

    margin-bottom: 6px;

    font-size: 13px;
}

.match-card small {
    color: #878d99;

    font-size: 9px;
}


/* =========================================================
   OUTFIT BUILDER
========================================================= */

.outfit-builder {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;

    align-items: center;

    gap: 18px;

    max-width: 1000px;
}

.outfit-item {
    min-height: 180px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: #ffffff;

    text-align: center;
}

.outfit-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 13px;

    border-radius: 14px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 22px;
}

.outfit-color-block {
    width: 58px;
    height: 58px;

    margin: 0 auto 13px;

    border-radius: 14px;

    background: #F5F0E8;
}

.outfit-item span {
    color: var(--muted);

    font-size: 9px;

    margin-bottom: 4px;
}

.outfit-item strong {
    font-size: 13px;
}

.outfit-connector {
    color: #a5a9b5;

    font-size: 22px;
    font-weight: 700;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.accessibility-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 15px;
}

.accessibility-card {
    padding: 20px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 13px;
}

.accessibility-card i {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 14px;

    border-radius: 10px;

    background: var(--primary-soft);
    color: var(--primary);
}

.accessibility-card h3 {
    margin-bottom: 7px;

    font-size: 15px;
}

.accessibility-card p {
    color: var(--muted);

    font-size: 11px;
    line-height: 1.65;
}

.accessibility-toggle-card {
    margin-top: 22px;

    padding: 21px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 14px;
}

.accessibility-toggle-card h3 {
    margin-bottom: 4px;

    font-size: 17px;
}

.accessibility-toggle-card p:last-child {
    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   TOGGLE
========================================================= */

.switch {
    position: relative;

    width: 52px;
    height: 28px;

    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;

    inset: 0;

    border-radius: 999px;

    background: #ccd0d9;

    cursor: pointer;

    transition: 0.25s ease;
}

.slider::before {
    content: "";

    position: absolute;

    width: 22px;
    height: 22px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #ffffff;

    transition: 0.25s ease;
}

.switch input:checked+.slider {
    background: var(--primary);
}

.switch input:checked+.slider::before {
    transform: translateX(24px);
}


/* =========================================================
   ROADMAP
========================================================= */

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 16px;
}

.roadmap-card {
    position: relative;

    padding: 22px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #ffffff;
}

.roadmap-card>span {
    display: block;

    margin-bottom: 16px;

    color: #c2c0ff;

    font-size: 28px;
    font-weight: 800;
}

.roadmap-card h3 {
    margin-bottom: 7px;

    font-size: 15px;
}

.roadmap-card p {
    color: var(--muted);

    font-size: 11px;
    line-height: 1.65;
}


/* =========================================================
   CTA
========================================================= */

.app-cta {
    margin: 0 7% 70px;

    padding: 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    border-radius: 18px;

    background:
        linear-gradient(135deg,
            #2c275a,
            #6c63ff 65%,
            #8b76ff);

    color: #ffffff;
}

.app-cta .section-label {
    color: #dad6ff;
}

.app-cta h2 {
    max-width: 700px;

    color: #ffffff;

    font-size: 34px;

    margin-bottom: 9px;
}

.app-cta p {
    max-width: 680px;

    color: #e7e5ff;

    font-size: 13px;
}

.cta-btn {
    flex-shrink: 0;

    padding: 12px 18px;

    border-radius: 8px;

    background: #ffffff;
    color: var(--primary-dark);

    font-size: 12px;
    font-weight: 700;

    transition: 0.2s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
}


/* =========================================================
   ACCESSIBILITY MODE
========================================================= */

body.accessibility-mode .detected-color-display h3,
body.accessibility-mode #summary-color-name,
body.accessibility-mode #hero-color-name {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
}

body.accessibility-mode .match-card {
    border-width: 2px;
}

body.accessibility-mode .match-card strong {
    font-size: 14px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .app-hero {
        grid-template-columns: 1fr;
    }

    .hero-phone-preview {
        justify-content: flex-start;
    }

    .detect-grid,
    .recommendation-layout {
        grid-template-columns: 1fr;
    }

    .accessibility-grid,
    .roadmap-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 850px) {

    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        min-height: auto;

        position: static;
    }

    .app-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sidebar-note {
        margin-top: 20px;
    }

    .app-hero {
        padding: 55px 6%;
    }

    .app-section {
        padding: 65px 6%;
    }

}


@media (max-width: 700px) {

    .app-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .phone-frame {
        width: 100%;
        max-width: 320px;
    }

    .color-details {
        grid-template-columns: 1fr;
    }

    .match-grid {
        grid-template-columns: 1fr;
    }

    .outfit-builder {
        grid-template-columns: 1fr;
    }

    .outfit-connector {
        text-align: center;
    }

    .accessibility-grid,
    .roadmap-grid {
        grid-template-columns: 1fr;
    }

    .app-cta {
        margin: 0 5% 50px;

        padding: 32px 24px;

        flex-direction: column;
        align-items: flex-start;
    }

    .cta-btn {
        width: 100%;
        text-align: center;
    }

}


@media (max-width: 480px) {

    .hero-copy h1 {
        font-size: 34px;
    }

    .section-heading h2 {
        font-size: 30px;
    }

    .app-section {
        padding: 55px 5%;
    }

    .upload-card,
    .color-result-card {
        padding: 21px;
    }

    .accessibility-toggle-card {
        flex-direction: column;
        align-items: flex-start;
    }

}

#detect-color-btn {
    margin-top: 16px;
}

.confirm-color-btn {
    margin-top: 22px;
    width: 100%;
    border: none;
    cursor: pointer;
}