/* Sommelier Snap Beta Portal - Card-Based Layout */
/* Brand colors from WineDesignTokens (design_tokens.dart) */

:root {
    --wine-red: #8B2635;
    --wine-red-dark: #6B1E2C;
    --gold-accent: #D4AF37;
    --parchment: #FAF7F2;
    --warm-white: #FFFDF8;
    --smokey-glass: #F5F3F0;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #666666;
    --error-red: #D32F2F;
    --success-green: #2E7D32;
    --border-color: #E0E0E0;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(170deg, var(--parchment) 0%, #EDE8E3 50%, #E8E3DD 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
}

/* ======================== */
/* Container & Layout       */
/* ======================== */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.container-inner {
    /* Legacy support: no longer needed in card layout, but keep for HTML compat */
    padding: 0;
}

/* ======================== */
/* Card Component           */
/* ======================== */

.card {
    background: var(--warm-white);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.card h2 {
    color: var(--wine-red);
}

/* ======================== */
/* Hero Header (full-width) */
/* ======================== */

.hero-header {
    position: relative;
    background: url('assets/images/heroes/vineyard_sunrise.webp') center/cover no-repeat;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.hero-header--guide {
    background-image: url('assets/images/heroes/cellar_barrels.webp');
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 26, 26, 0.3) 0%,
        rgba(107, 30, 44, 0.75) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px 24px;
}

.hero-logo {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.hero-content h1 {
    font-family: var(--font-display);
    color: white;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hero-content .tagline {
    color: var(--gold-accent);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 1.5px;
}

/* ======================== */
/* Typography               */
/* ======================== */

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--wine-red);
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--wine-red-dark);
}

p {
    margin-bottom: 12px;
}

/* ======================== */
/* Logo Section (Passcode)  */
/* ======================== */

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section h1 {
    color: var(--wine-red);
}

.tagline {
    color: var(--gold-accent);
    font-size: 16px;
    font-weight: 500;
}

/* ======================== */
/* Passcode Section         */
/* ======================== */

.passcode-section {
    text-align: center;
}

.passcode-section p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

#passcode-input {
    width: 100%;
    max-width: 300px;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    background: var(--warm-white);
}

#passcode-input:focus {
    outline: none;
    border-color: var(--wine-red);
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.1);
}

#passcode-input.input-error {
    border-color: var(--error-red);
}

.btn-primary {
    background: var(--wine-red);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background: var(--wine-red-dark);
    transform: translateY(-2px);
}

.error {
    color: var(--error-red);
    margin-top: 12px;
    font-size: 14px;
}

/* ======================== */
/* Consent Section          */
/* ======================== */

.consent-section {
    border: 2px solid var(--gold-accent);
    background: #FFF8E6;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.consent-box {
    border: 2px solid var(--gold-accent);
    background: #FFF8E6;
    padding: 20px;
    border-radius: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.checkbox-container input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--wine-red);
}

/* ======================== */
/* Download Section         */
/* ======================== */

.download-section {
    text-align: center;
    margin-bottom: 30px;
}

.download-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.download-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.platform-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 32px;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
}

.download-button .btn-text {
    font-size: 18px;
    font-weight: 700;
}

.download-button .btn-subtext {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.92;
    margin-top: 4px;
}

.download-button.android {
    background: linear-gradient(135deg, #3DDC84 0%, #2CA05E 100%);
}

.download-button.ios {
    background: linear-gradient(135deg, #007AFF 0%, #0055CC 100%);
}

.download-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.download-button.highlight {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ======================== */
/* Version Info             */
/* ======================== */

.version-info {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.version-badge {
    display: inline-block;
    background: var(--wine-red);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.build-date {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* ======================== */
/* Documentation Grid       */
/* ======================== */

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.note-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--parchment);
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.note-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.note-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.note-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.note-content h4 a {
    color: var(--wine-red);
    text-decoration: none;
    transition: color 0.2s;
}

.note-content h4 a:hover {
    color: var(--wine-red-dark);
    text-decoration: underline;
}

.note-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* ======================== */
/* Instruction Steps        */
/* ======================== */

.instruction-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--wine-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.step-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* ======================== */
/* Instructions Tabs        */
/* ======================== */

.instructions-section {
    margin-bottom: 30px;
}

.instructions-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--wine-red);
}

.tab-btn.active {
    color: var(--wine-red);
    border-bottom-color: var(--wine-red);
}

.tab-content {
    display: none;
    text-align: left;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--wine-red);
}

.tab-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.tab-content li {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ======================== */
/* Troubleshooting Callout  */
/* ======================== */

.troubleshooting {
    background: #FFF8E6;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--gold-accent);
}

.troubleshooting h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--gold-accent);
}

.troubleshooting ul {
    list-style: none;
    font-size: 14px;
}

.troubleshooting li {
    margin-bottom: 8px;
}

/* ======================== */
/* Notice Section           */
/* ======================== */

.notice-section {
    background: var(--smokey-glass);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.notice-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.notice-section ul {
    margin-left: 20px;
}

.notice-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 14px;
}

/* ======================== */
/* Footer                   */
/* ======================== */

.footer {
    text-align: center;
    padding: 28px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--wine-red);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 0;
}

/* ======================== */
/* Legal Page Styles        */
/* ======================== */

.legal-content {
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
}

.legal-date {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 24px;
    font-size: 14px;
}

.legal-section {
    margin-bottom: 28px;
}

.legal-section h2 {
    color: var(--wine-red);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.legal-section h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.legal-section ul, .legal-section ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.legal-section li {
    margin-bottom: 6px;
    line-height: 1.6;
    font-size: 15px;
}

.legal-section p {
    font-size: 15px;
}

.legal-warning {
    background: #FFF8E6;
    border-left: 4px solid var(--gold-accent);
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
}

.legal-danger {
    background: #FFEBEE;
    border-left: 4px solid var(--error-red);
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.legal-caps {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ======================== */
/* User Guide Styles        */
/* ======================== */

.guide-intro {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-secondary);
    font-size: 16px;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.guide-card {
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 16px var(--shadow-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-medium);
}

.guide-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.guide-card-content {
    padding: 16px;
}

.guide-card-content h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--wine-red);
}

.guide-card-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.guide-section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--wine-red);
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold-accent);
}

/* Collapsible sections */
.guide-section {
    margin-bottom: 12px;
}

.guide-section summary {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--wine-red);
    cursor: pointer;
    padding: 16px 20px;
    background: var(--smokey-glass);
    border-radius: 12px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.guide-section summary:hover {
    background: #EDEBE7;
}

.guide-section summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 700;
    color: var(--wine-red);
    transition: transform 0.2s;
}

.guide-section[open] summary::after {
    content: '\2212';
}

.guide-section summary::-webkit-details-marker {
    display: none;
}

.guide-section[open] summary {
    border-radius: 12px 12px 0 0;
    background: var(--wine-red);
    color: white;
}

.guide-section[open] summary::after {
    color: white;
}

.guide-section-content {
    padding: 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.guide-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 14px 0;
}

.guide-step-number {
    background: var(--wine-red);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.guide-step-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.guide-tip {
    background: #F0F7F0;
    border-left: 4px solid var(--success-green);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 14px 0;
    font-size: 14px;
}

.guide-tip strong {
    color: var(--success-green);
}

.guide-note {
    background: var(--smokey-glass);
    border-left: 4px solid var(--gold-accent);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 14px 0;
    font-size: 14px;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 16px;
}

.faq-item h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.faq-item p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ======================== */
/* Back to Top Button       */
/* ======================== */

.back-to-top {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--wine-red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 38, 53, 0.3);
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 100;
}

.back-to-top:hover {
    background: var(--wine-red-dark);
    transform: translateY(-2px);
}

/* ======================== */
/* Responsive               */
/* ======================== */

@media (max-width: 840px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }

    .card {
        padding: 28px 24px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 24px 20px;
        border-radius: 14px;
        margin-bottom: 20px;
    }

    .hero-header {
        min-height: 200px;
    }

    .hero-content h1 {
        font-size: 26px;
    }

    .hero-logo {
        width: 64px;
        height: 64px;
    }

    .platform-buttons {
        flex-direction: column;
    }

    .download-button {
        width: 100%;
    }

    .guide-cards {
        grid-template-columns: 1fr;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .legal-content {
        padding: 0;
    }

    .instruction-step {
        gap: 12px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .hero-content h1 {
        font-size: 22px;
    }

    .hero-logo {
        width: 56px;
        height: 56px;
    }

    .hero-content {
        padding: 28px 16px;
    }
}

/* ======================== */
/* App Summary              */
/* ======================== */

.app-summary-intro {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ======================== */
/* What's New card          */
/* ======================== */

.whats-new-section {
    border-left: 4px solid var(--wine-red);
}

.whats-new-intro {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.whats-new-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whats-new-list li {
    padding: 12px 16px;
    background: var(--parchment);
    border-radius: 10px;
    margin-bottom: 10px;
    line-height: 1.55;
    font-size: 0.95rem;
}

.whats-new-list li strong {
    color: var(--wine-red);
}

/* ======================== */
/* User Guide (prominent)   */
/* ======================== */

.user-guide-section {
    background: linear-gradient(135deg, var(--warm-white) 0%, var(--parchment) 100%);
    border: 2px solid var(--wine-red);
}

.user-guide-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    text-decoration: none;
}

.user-guide-cta .btn-arrow {
    font-size: 1.1em;
    transition: transform 0.15s ease;
}

.user-guide-cta:hover .btn-arrow {
    transform: translateX(3px);
}

/* ======================== */
/* iOS notice (setup tab)   */
/* ======================== */

.ios-notice {
    background: var(--parchment);
    border-left: 4px solid var(--wine-red);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ios-notice p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.55;
}

.ios-notice a {
    color: var(--wine-red);
    font-weight: 600;
}

.ios-when-approved {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

/* ======================== */
/* Subpage top-nav          */
/* ======================== */

.subpage-nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.subpage-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wine-red);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.subpage-back:hover {
    color: var(--wine-red-dark);
    text-decoration: underline;
}

.subpage-version {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

/* ======================== */
/* Platform QR codes        */
/* ======================== */

.platform-qr-row {
    margin-top: 24px;
}

.platform-qr-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.platform-qr-codes {
    display: flex;
    gap: 28px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.platform-qr img {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    background: white;
    padding: 8px;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.platform-qr span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* QR codes only help when you're on a computer; hide on phones */
@media (max-width: 640px) {
    .platform-qr-row {
        display: none;
    }
}

/* ======================== */
/* Floating Feedback Button */
/* ======================== */

.feedback-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wine-red);
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 28px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(139, 38, 53, 0.35);
    transition: background 0.2s, transform 0.2s;
    z-index: 100;
}

.feedback-fab:hover {
    background: var(--wine-red-dark);
    transform: translateY(-2px);
}

.feedback-fab-icon {
    font-size: 18px;
    line-height: 1;
}

/* Icon-only on small phones so it doesn't crowd the screen */
@media (max-width: 480px) {
    .feedback-fab {
        padding: 14px;
        border-radius: 50%;
    }

    .feedback-fab-text {
        display: none;
    }
}
