/* Modern Design System for Deliciously Fit N Healthy */

/* =============================================================================
   BRAND TOKENS — DFH palette, Aug 2026
   Change a colour here and it changes everywhere in this file.
   ============================================================================= */

:root {
    /* Brand */
    --brand-teal: #1B5B65;
    --brand-teal-deep: #144850;

    /* Coral / CTA */
    --accent-coral: #E8735A;
    --accent-coral-deep: #D05A41;   /* hover / pressed */
    --tint-coral-soft: #F6C5B8;     /* soft highlight badges and tags */

    /* Surfaces */
    --surface-cream: #F6F4F1;       /* page background, default light section */
    --surface-cream-2: #F5F3EE;     /* alternating sections, subtle hover fills */
    --surface-dark: #1F1F1D;
    --white: #FFFFFF;               /* card fills on cream */

    /* Text */
    --text-on-light: #1F1F1D;
    --text-muted-light: #4B565C;
    --text-on-dark: #F6F4F1;
    --text-muted-dark: #C0C1BB;

    /* Borders */
    --border-soft: #E4E3DD;         /* card borders, dividers on light */
    --border-soft-2: #DDD9D0;       /* subtler dividers, column rules */

    /* Derived tints — alpha over brand colours, not new brand colours */
    --tint-teal-soft: rgba(27, 91, 101, 0.10);
    --tint-coral-hover: rgba(232, 115, 90, 0.08);
    --focus-coral-ring: rgba(232, 115, 90, 0.18);
    --shadow-coral: rgba(232, 115, 90, 0.28);
    --shadow-teal: rgba(27, 91, 101, 0.24);

    /* Functional status colours — UI states, deliberately outside the brand
       palette so success/warning/error stay distinguishable from each other. */
    --status-success-bg: #E7F0EF;
    --status-success-text: #164E45;
    --status-warning-bg: #FBEEDC;
    --status-warning-text: #8A5A16;
    --status-error-bg: #FBE9E7;
    --status-error-text: #A4331F;
    --status-info-bg: #ECEFF1;
    --status-info-text: #3D4A52;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--surface-cream);
    color: var(--text-on-light);
}

/* Layout with Sidebar */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border-soft);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 40px;
}

.sidebar-logo img {
    max-width: 100px;
    height: auto;
}

.sidebar-welcome {
    padding: 20px;
    background: var(--brand-teal);
    border-radius: 16px;
    margin-bottom: 30px;
    color: var(--text-on-dark);
    text-align: center;
}

.sidebar-welcome h3 {
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 600;
}

.sidebar-welcome p {
    font-size: 14px;
    color: var(--text-muted-dark);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-on-light);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--tint-coral-hover);
    color: var(--accent-coral-deep);
}

.sidebar-nav a.active {
    background: var(--accent-coral);
    color: var(--white);
}

.sidebar-nav a span {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: var(--surface-cream-2);
    color: var(--text-on-light);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--accent-coral);
    border-color: var(--accent-coral);
    color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px 60px;
    max-width: 1400px;
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-on-light);
    margin-bottom: 8px;
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted-light);
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(31, 31, 29, 0.04);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(31, 31, 29, 0.08);
}

.card h2 {
    font-size: 22px;
    color: var(--text-on-light);
    margin-bottom: 20px;
    font-weight: 600;
}

.card h3 {
    font-size: 18px;
    color: var(--text-on-light);
    margin-bottom: 12px;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-coral);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-coral-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-coral);
}

.btn-secondary {
    background: var(--brand-teal);
    color: var(--text-on-dark);
}

.btn-secondary:hover {
    background: var(--brand-teal-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-teal);
}

.btn-outline {
    background: var(--white);
    border: 2px solid var(--accent-coral);
    color: var(--accent-coral);
}

.btn-outline:hover {
    background: var(--accent-coral);
    color: var(--white);
}

/* NEW: btn-danger and btn-tertiary are used by subscriptions.html but were
   never defined, so those buttons rendered with no background at all.
   Destructive and step-back actions are deliberately quiet rather than coral —
   coral is reserved for the action we want people to take. */
.btn-danger {
    background: var(--white);
    border: 1px solid var(--border-soft-2);
    color: var(--text-on-light);
}

.btn-danger:hover {
    background: var(--tint-coral-hover);
    border-color: var(--accent-coral);
    color: var(--accent-coral-deep);
}

.btn-tertiary {
    background: transparent;
    border: none;
    color: var(--text-muted-light);
    text-decoration: underline;
}

.btn-tertiary:hover {
    color: var(--text-on-light);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-soft);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-coral);
    box-shadow: 0 0 0 3px var(--focus-coral-ring);
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-on-light);
    font-weight: 500;
    font-size: 14px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.badge-info {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

/* Messages */
.message {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    animation: slideDown 0.3s ease;
}

.message.success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border-left: 4px solid var(--brand-teal);
}

.message.error {
    background: var(--status-error-bg);
    color: var(--status-error-text);
    border-left: 4px solid var(--accent-coral-deep);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted-light);
    font-size: 16px;
}

/* Smooth page transitions */
.main-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =============================================================================
   ACTIVE PILL ALIGNMENT FIX
   ============================================================================= */

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed from flex-start */
    margin-bottom: 20px;
}

.subscription-status,
.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--tint-teal-soft);
    color: var(--brand-teal);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
}

/* =============================================================================
   HAMBURGER MENU FOR MOBILE
   ============================================================================= */

.hamburger-btn {
    font-size: 24px;
    color: var(--text-on-light) !important;
    line-height: 1;
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--text-on-light);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    z-index: 150;
    position: fixed;
    top: 20px;
    left: 20px;
    box-shadow: 0 2px 8px rgba(31, 31, 29, 0.15);
}

.hamburger-btn span {
    opacity: 1 !important;
    visibility: visible !important;
    content: "" !important;
    display: block !important;
    -webkit-appearance: none !important;
    width: 100%;
    height: 3px;
    background: transparent !important;
    border-top: 3px solid var(--text-on-light) !important;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 31, 29, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* =============================================================================
   MOBILE RESPONSIVE - COMPACT & EFFICIENT
   ============================================================================= */

@media (max-width: 768px) {
    /* HAMBURGER MENU - NOW VISIBLE WITH WHITE BACKGROUND */
.hamburger-btn {
    font-size: 24px;
    color: var(--text-on-light) !important;
    line-height: 1;
        display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--text-on-light);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    z-index: 150;
    position: fixed;
    top: 20px;
    left: 20px;
    box-shadow: 0 2px 8px rgba(31, 31, 29, 0.15);
}
    
    /* SIDEBAR - SLIDE IN FROM LEFT */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 100;
        box-shadow: 2px 0 10px rgba(31, 31, 29, 0.1);
        padding-bottom: 100px;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* MAIN CONTENT - COMPACT SPACING */
    .main-content {
        margin-left: 0;
        padding: 70px 16px 20px 16px; /* Top padding for hamburger button */
        width: 100%;
    }
    
    /* PAGE HEADER - SMALLER ON MOBILE */
    .page-header h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    /* STATS CARDS - MUCH SMALLER TEXT */
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .stat-card .number {
        font-size: 24px !important; /* Reduced from 42px */
        margin-bottom: 6px;
    }
    
    .stat-card .label {
        font-size: 12px;
    }
    
    /* SUBSCRIPTION CARDS - SMALLER DATES */
    .sub-card {
        padding: 16px;
    }
    
    .sub-card .product-name {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .sub-card .price {
        font-size: 20px !important; /* Reduced from 28px */
        margin-bottom: 10px;
    }
    
    .sub-card .next-billing {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .sub-card .badge {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    /* CARDS - MORE COMPACT */
    .card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .card h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    /* BUTTONS - SLIGHTLY SMALLER */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* QUICK ACTIONS - COMPACT */
    .action-btn {
        padding: 16px;
    }
    
    .action-btn .icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .action-btn .text {
        font-size: 13px;
    }
    
    /* ANNOUNCEMENT BANNER - COMPACT */
    .announcement-banner {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .announcement-banner .icon {
        font-size: 28px;
    }
    
    .announcement-banner .content h3 {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .announcement-banner .content p {
        font-size: 13px;
    }
    
    /* PURCHASE ITEMS - COMPACT */
    .purchase-item {
        padding: 16px;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .purchase-detail-row {
        font-size: 12px;
    }
    
    .status-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* SUMMARY CARDS - COMPACT */
    .summary-card {
        padding: 16px;
    }
    
    .summary-number {
        font-size: 28px;
    }
    
    .summary-label {
        font-size: 12px;
    }
    
    /* =============================================================================
       BILLING HISTORY TABLE - MOBILE CARD LAYOUT
       ============================================================================= */
    
    /* Hide table on mobile and show card layout instead */
    .billing-table {
        display: none !important;
    }
    
    /* Mobile invoice cards */
    .invoice-card-mobile {
        background: var(--white);
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 4px rgba(31, 31, 29, 0.04);
    }
    
    .invoice-card-mobile .invoice-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        font-size: 13px;
    }
    
    .invoice-card-mobile .invoice-row:last-child {
        margin-bottom: 0;
    }
    
    .invoice-card-mobile .invoice-label {
        color: var(--text-muted-light);
        font-weight: 600;
        font-size: 12px;
    }
    
    .invoice-card-mobile .invoice-value {
        color: var(--text-on-light);
        font-weight: 500;
        text-align: right;
    }
    
    .invoice-card-mobile .invoice-description {
        font-size: 12px;
        color: var(--text-on-light);
        line-height: 1.4;
    }
    
    .invoice-card-mobile .invoice-actions {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-soft);
    }
    
    .invoice-card-mobile .btn-view-pdf {
        width: 100%;
        padding: 10px;
        background: var(--brand-teal);
        color: var(--text-on-dark);
        border: none;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        text-align: center;
        text-decoration: none;
        display: block;
    }
    
    .invoice-status-badge {
        display: inline-block;
        padding: 5px 12px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
    }
    
    .invoice-status-badge.paid {
        background: var(--tint-teal-soft);
        color: var(--brand-teal);
    }
}

/* ENSURE HAMBURGER NEVER SHOWS ON DESKTOP */
@media (min-width: 769px) {
    .sidebar {
        left: 0 !important;
    }
    
.hamburger-btn {
    font-size: 24px;
    color: var(--text-on-light) !important;
    line-height: 1;
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--text-on-light);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    z-index: 150;
    position: fixed;
    top: 20px;
    left: 20px;
    box-shadow: 0 2px 8px rgba(31, 31, 29, 0.15);
}
    
    /* Hide mobile invoice cards on desktop */
    .invoice-card-mobile {
        display: none !important;
    }
}
