/* ============================================================
   JANNING GROUP – SGU-Portal  |  page-sgu-portal.css
   Theme: Verdant (Light & Dark)
   ============================================================ */

/* Verdant Color System - Light Mode */
:root {
    --primary: #2e7d32;
    --primary-foreground: #ffffff;
    --background: #f8f5f0;
    --foreground: #3e2723;
    --card: #f8f5f0;
    --card-foreground: #3e2723;
    --secondary: #e8f5e9;
    --secondary-foreground: #1b5e20;
    --accent: #c8e6c9;
    --accent-foreground: #1b5e20;
    --muted: #f0e9e0;
    --muted-foreground: #6d4c41;
    --border: #e0d6c9;
    --destructive: #c62828;
    --destructive-foreground: #ffffff;
    --ring: #2e7d32;
    --sidebar: #f0e9e0;

    --font-sans: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: Merriweather, serif;
    --font-mono: 'Source Code Pro', monospace;
}

/* Verdant Color System - Dark Mode */
:root.dark {
    --primary: #4caf50;
    --primary-foreground: #0a1f0c;
    --background: #1c2a1f;
    --foreground: #f0ebe5;
    --card: #2d3a2e;
    --card-foreground: #f0ebe5;
    --secondary: #3e4a3d;
    --secondary-foreground: #d7e0d6;
    --accent: #388e3c;
    --accent-foreground: #f0ebe5;
    --muted: #2d3a2e;
    --muted-foreground: #d7cfc4;
    --border: #3e4a3d;
    --destructive: #c62828;
    --destructive-foreground: #f0ebe5;
    --ring: #4caf50;
    --sidebar: #1c2a1f;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }
body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    line-height: 1.55;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== APP CONTAINER ===== */
#app {
    width: 100%;
    min-height: 100vh;
}

.view {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.site-header {
    background: var(--card);
    border-bottom: 4px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    position: relative;
}

.logo-block {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-align: center;
}

.logo-main {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 0.04em;
    color: var(--foreground);
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--primary);
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===== MAIN CONTENT ===== */
.form-container {
    max-width: 1040px;
    margin: 32px auto 60px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-badge {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-start {
    background: var(--primary);
    color: var(--primary-foreground);
    transition: background 0.3s ease, color 0.3s ease;
}

.badge-monthly {
    background: var(--muted);
    color: var(--foreground);
    transition: background 0.3s ease, color 0.3s ease;
}

.section-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.section-desc {
    font-size: 0.88rem;
    color: var(--muted-foreground);
    font-weight: 500;
    white-space: nowrap;
}

/* ===== SECTION BLOCK ===== */
.section-block {
    background: var(--card);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.section-block:nth-child(1) { animation-delay: 0.1s; }
.section-block:nth-child(2) { animation-delay: 0.25s; }
.section-block:nth-child(3) { animation-delay: 0.4s; }

/* ===== TOGETHER NOTE ===== */
.together-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(46,125,50,0.1);
    border: 1px solid rgba(46,125,50,0.3);
    border-radius: 7px;
    font-size: 0.83rem;
    color: var(--primary);
    font-weight: 600;
}

.together-note svg { flex-shrink: 0; margin-top: 2px; }

/* ===== CARDS GRID ===== */
.cards-grid {
    display: grid;
    gap: 14px;
}

.cards-grid + .cards-grid {
    margin-top: 14px;
}

.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid-1 { grid-template-columns: 1fr; }

/* Single card in a row - center and limit width */
.cards-grid-1.single-card {
    grid-template-columns: 1fr;
    max-width: 52%;
    margin-left: auto;
    margin-right: auto;
}

/* ===== MODULE CARD ===== */
.module-card {
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.08);
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

/* ===== STEP NUMBER BADGE ===== */
.step-num {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.step-num.monthly {
    background: var(--muted);
    color: var(--foreground);
}

/* ===== CARD ICON ===== */
.card-icon {
    width: 42px; height: 42px; min-width: 42px;
    color: var(--primary);
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.card-icon svg { width: 100%; height: 100%; }

/* ===== CARD CONTENT ===== */
.card-content { flex: 1; display: flex; flex-direction: column; gap: 3px; }

.card-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.card-description {
    font-size: 0.88rem;
    color: var(--muted-foreground);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.card-description strong { color: var(--foreground); }

.card-arrow {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: bold;
    transition: transform 0.2s, color 0.3s ease;
    flex-shrink: 0;
}

.module-card:hover .card-arrow { transform: translateX(4px); }

/* ===== DEADLINE PILL ===== */
.deadline-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(46,125,50,0.1);
    border: 1px solid rgba(46,125,50,0.3);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 5px;
    width: fit-content;
}

/* ===== MODULE VIEW ===== */
#module-view { background: var(--background); }

.site-header.module-active .header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    background: var(--muted);
    border: none;
    color: var(--foreground);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: absolute;
    left: 24px;
    text-decoration: none;
}

.back-button:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translateX(-2px);
}

.back-button svg { width: 18px; height: 18px; }

.module-active .logo-block { margin: 0 auto; }

#module-frame {
    width: 100%;
    height: calc(100vh - 84px);
    border: none;
    display: block;
    background: var(--background);
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    position: absolute;
    right: 24px;
    background: var(--muted);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .header-inner { height: auto; padding: 14px 16px; }
    .logo-main { font-size: 1.4rem; }
    .form-container { padding: 0 14px; margin: 20px auto 40px; gap: 22px; }
    .cards-grid-2 { grid-template-columns: 1fr; }
    .cards-grid-1.single-card { max-width: 100%; }
    .back-button { left: 16px; padding: 0.5rem 0.7rem; font-size: 0.8rem; }
    .back-text { display: none; }
    #module-frame { height: calc(100vh - 76px); }
    .section-desc { display: none; }
    .section-block { padding: 14px; }
}

@media (max-width: 480px) {
    .header-inner { padding: 12px; }
    .logo-main { font-size: 1.3rem; }
    .logo-sub { font-size: 0.6rem; }
    .module-card { padding: 14px; gap: 12px; }
    .card-icon { width: 38px; height: 38px; min-width: 38px; }
    .card-title { font-size: 1.05rem; }
    .card-description { font-size: 0.82rem; }
    .form-container { padding: 0 12px; }
    .back-button { padding: 0.4rem 0.6rem; left: 12px; }
}
