/* Core Design System Tokens */
:root {
    --bg-color: #101A16;
    --bg-accent: #13241E;
    --card-color: #F1E6CF;
    --card-accent: #EDE0C4;
    --text-primary: #2B2418;
    --text-muted: #74664E;
    --gold: #B88A3A;
    --gold-glow: rgba(184, 138, 58, 0.15);
    --border-color: rgba(184, 138, 58, 0.35);
    --border-hover: rgba(184, 138, 58, 0.65);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Nunito', sans-serif;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Reset and Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--gold) var(--bg-color);
    scrollbar-width: thin;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: #FFFFFF; /* Base body color for layout */
    line-height: 1.6;
    min-block-size: 100dvb;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;

    /* Subtle Ghanaian Kente-inspired background pattern */
    background-image: 
        linear-gradient(45deg, rgba(184, 138, 58, 0.03) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(184, 138, 58, 0.03) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(184, 138, 58, 0.03) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(184, 138, 58, 0.03) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

/* Typography elements */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}

/* Header Section */
.app-header {
    background-color: var(--bg-accent);
    border-bottom: 2px solid var(--gold);
    padding-block: 2.5rem 2rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.header-container {
    max-inline-size: 800px;
    margin-inline: auto;
    padding-inline: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.app-logo {
    max-block-size: 120px;
    inline-size: auto;
    margin-block-end: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.app-logo:hover {
    transform: scale(1.03);
    border-color: var(--gold);
}

.app-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--gold);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.app-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}

.last-updated {
    font-size: 0.85rem;
    color: var(--gold);
    opacity: 0.85;
    margin-block-start: 0.25rem;
    font-style: italic;
}

/* Main Layout Container */
.main-layout-container {
    max-inline-size: 1200px;
    margin-inline: auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
    flex: 1 0 auto;
}

/* Sticky Sidebar (Table of Contents) */
.sidebar-nav {
    position: sticky;
    top: 2rem;
    background-color: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    max-block-size: calc(100dvb - 4rem);
    overflow-y: auto;
}

.toc-title {
    font-size: 1.2rem;
    color: var(--gold);
    border-bottom: 1px solid var(--border-color);
    padding-block-end: 0.5rem;
    margin-block-end: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-link {
    color: #E2E8F0;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-inline-start: 2px solid transparent;
}

.toc-link:hover,
.toc-link:focus-visible {
    background-color: rgba(184, 138, 58, 0.1);
    color: var(--gold);
    border-inline-start-color: var(--gold);
}

.toc-link:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Main Content Card (Parchment Style) */
.content-card {
    background-color: var(--card-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

/* Content Card Decorative Ghanaian Corners */
.content-card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(184, 138, 58, 0.15);
    pointer-events: none;
    border-radius: 8px;
}

.policy-section {
    margin-block-end: 3rem;
}

.policy-section:last-of-type {
    margin-block-end: 0;
}

.policy-section h2 {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    color: #1A3E2F; /* Dark Teal/Green for heading */
    border-bottom: 2px solid var(--gold);
    padding-block-end: 0.5rem;
    margin-block-end: 1.25rem;
    font-weight: 700;
}

.policy-section p {
    margin-block-end: 1.2rem;
    font-size: 1.05rem;
    text-align: justify;
    color: var(--text-primary);
}

.policy-section p:last-child {
    margin-block-end: 0;
}

.policy-section ul,
.policy-section ol {
    margin-block-start: 0.5rem;
    margin-block-end: 1.2rem;
    padding-inline-start: 1.5rem;
}

.policy-section li {
    margin-block-end: 0.5rem;
    font-size: 1.05rem;
}

.policy-section li:last-child {
    margin-block-end: 0;
}

.policy-section strong {
    color: #1A3E2F;
}

/* Links inside policy card */
.policy-section a {
    color: #8C5D07;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.policy-section a:hover,
.policy-section a:focus-visible {
    color: var(--gold);
}

.policy-section a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

/* Local storage table decoration */
.table-container {
    overflow-x: auto;
    margin-block-end: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background-color: #FAF5EA;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--card-accent);
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
}

tr:last-child td {
    border-bottom: none;
}

/* Double columns info grid */
.grid-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-block-end: 1.2rem;
}

.grid-columns ul {
    margin-block: 0;
}

/* Custom Warning Alert Box */
.alert-box {
    background-color: var(--card-accent);
    border-inline-start: 4px solid var(--gold);
    padding: 1rem 1.25rem;
    margin-block: 1.5rem;
    border-radius: 0 6px 6px 0;
    font-size: 1.02rem !important;
}

/* Contact Info Area */
.contact-card {
    background-color: #FAF5EA;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-block-start: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-card p {
    margin-block-end: 0.5rem !important;
}

.contact-card p:last-child {
    margin-block-end: 0 !important;
}

/* Footer Section */
.app-footer {
    background-color: var(--bg-accent);
    color: #A0AEC0;
    padding-block: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.25);
    margin-block-start: auto;
}

.footer-container {
    max-inline-size: 800px;
    margin-inline: auto;
    padding-inline: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-footer p {
    font-size: 0.9rem;
}

/* Form Layout & Fields styling */
.support-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-block-start: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 700;
    color: #1A3E2F;
    display: inline-block;
}

.required-indicator {
    color: #C53030;
    margin-inline-start: 0.2rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    background-color: #FAF5EA;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    inline-size: 100%;
    min-block-size: 48px;
    box-sizing: border-box;
}

.form-group textarea {
    min-block-size: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-block-start: 0.2rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-block-start: 0.5rem;
}

/* Button Styling */
.btn {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.8rem 1.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-block-size: 48px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--gold);
    color: #101A16;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: #9C722D;
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: #FAF5EA;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--card-accent);
    border-color: var(--gold);
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.support-info-box {
    margin-block: 0;
}

.support-info-box.success {
    background-color: #E6FFFA;
    border-inline-start-color: #319795;
    color: #234E52;
}

.support-info-box.error {
    background-color: #FFF5F5;
    border-inline-start-color: #E53E3E;
    color: #742A2A;
}

/* Active sidebar link */
.toc-link.active {
    background-color: rgba(184, 138, 58, 0.1);
    color: var(--gold);
    border-inline-start-color: var(--gold);
    font-weight: 700;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .main-layout-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-block: 1.5rem;
    }

    .sidebar-nav {
        position: relative;
        top: 0;
        max-block-size: none;
        overflow-y: visible;
        padding: 1rem;
    }

    .toc-title {
        font-size: 1rem;
        margin-block-end: 0.75rem;
    }

    /* Horizontal scrollbar of links on mobile view */
    .toc-links {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding-block-end: 0.5rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
    }

    .toc-link {
        border-inline-start: none;
        border: 1px solid var(--border-color);
        background-color: rgba(255, 255, 255, 0.05);
        padding: 0.4rem 0.8rem;
        border-radius: 20px;
        font-size: 0.85rem;
    }

    .toc-link:hover,
    .toc-link:focus-visible {
        border-color: var(--gold);
        background-color: rgba(184, 138, 58, 0.2);
    }
}

@media (max-width: 600px) {
    .app-header {
        padding-block: 1.5rem 1.25rem;
    }

    .app-logo {
        max-block-size: 90px;
    }

    .content-card {
        padding: 1.75rem 1.25rem;
    }

    .policy-section h2 {
        padding-block-end: 0.3rem;
        margin-block-end: 1rem;
    }

    .policy-section p, 
    .policy-section li {
        font-size: 0.98rem;
    }

    .contact-card {
        padding: 1rem;
    }
}
