@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');

/* ==========================================================================
   DESIGN TOKENS (Apple Minimalist Architecture + Testbase Brand Identity)
   ========================================================================== */
:root {
    /* --- EREDETI MÁRKASZÍNEK (Szigorúan változatlan) --- */
    --primary-dark: #026634;    
    --primary-accent: #92c01f;  
    --primary-hover: #3da435;   
    --primary-focus: #92c01f;
    
    --danger-dark: #c53030;
    --danger-hover: #9b2c2c;

    /* --- APPLE FELÜLETI SZÍNEK (DESIGN.MD ALAPJÁN) --- */
    --canvas: #ffffff;
    --canvas-parchment: #f5f5f7;
    --surface-tile-dark: #1d1d1f;
    --surface-tile-subtle: #272729;
    
    /* Konzisztencia a meglévő osztályokkal */
    --bg-main: var(--canvas-parchment);
    --bg-panel: var(--canvas);
    
    /* --- HAJSZÁLVONALAK ÉS KERETEK --- */
    --hairline: #e0e0e0;
    --border-color: #e0e0e0;
    --divider-soft: rgba(0, 0, 0, 0.05);

    /* --- APPLE TÍPUSÚ TINTA & SZÖVEGSZÍNEK --- */
    --text-main: #1d1d1f;           /* Apple Ink - mély, természetes sötét */
    --text-muted: #7a7a7a;          /* Ink Muted 48 */
    --text-muted-dark: #333333;     /* Ink Muted 80 */
    --text-on-dark: #ffffff;
    --text-muted-on-dark: #a1a1a6;

    /* --- APPLE LEKEREKÍTÉSI SKÁLA (BORDER RADIUS) --- */
    --radius-none: 0px;
    --radius-xs: 5px;
    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 18px;              /* Store utility cards standard */
    --radius-pill: 9999px;          /* Signature Apple capsule pill */

    /* --- ELEVATION (APPLE SHADOW PHILOSOPHY: ZERO CHROME SHADOWS) --- */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 20px 40px rgba(0, 0, 0, 0.08);
    --shadow-product: 3px 5px 30px rgba(0, 0, 0, 0.15); /* Halvány, lebegtetett súly */
}

/* ==========================================================================
   ALAPBEÁLLÍTÁSOK ÉS TIPOGRÁFIA
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.47;
    letter-spacing: -0.374px;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   MINIMALISTA LOADING ANIMÁCIÓ
   ========================================================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    pointer-events: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid rgba(2, 102, 52, 0.15);
    border-top-color: var(--primary-accent);
    border-radius: var(--radius-pill);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* ==========================================================================
   FEJLÉC ÉS GLOBÁLIS NAVIGÁCIÓ
   ========================================================================== */
header {
    background: var(--primary-dark);
    color: var(--text-on-dark);
    padding: 0 32px;
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 100;
}

header h1 {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.224px;
    color: var(--text-on-dark);
    margin: 0;
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.12px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.nav-link:active {
    transform: scale(0.95);
}

/* ==========================================================================
   FŐ TARTALOM ÉS RESZPONZÍV GRID
   ========================================================================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 80px 24px;
    width: 100%;
    flex-grow: 1;
}

.welcome-section {
    text-align: center;
    padding: 64px 20px 48px 20px;
}

.welcome-section h2 {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.28px;
    color: var(--text-main);
    margin-bottom: 12px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 19px;
    font-weight: 400;
    line-height: 1.42;
    letter-spacing: 0;
    max-width: 680px;
    margin: 0 auto;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   KÁRTYÁK (APPLE UTILITY CARD STÍLUS)
   ========================================================================== */
.card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--hairline);
    padding: 28px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-accent);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
}

.app-card:active {
    transform: scale(0.98);
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(146, 192, 31, 0.12);
    color: var(--primary-dark);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-card h3 {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.224px;
    color: var(--text-main);
    margin: 0;
    transition: color 0.2s ease;
}

.app-card:hover h3 {
    color: var(--primary-dark);
}

.app-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: -0.224px;
    margin: 0;
    flex-grow: 1;
}

.app-card-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--divider-soft);
}

.app-link-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease, color 0.2s ease;
}

.app-card:hover .app-link-text {
    color: var(--primary-hover);
    gap: 7px;
}

/* ==========================================================================
   GOMBOK (APPLE PILL GRAMMAR & MICRO-INTERACTION)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: -0.224px;
    text-decoration: none;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.btn:active {
    transform: scale(0.95); /* Apple system-wide micro-interaction */
}

.btn:focus-visible {
    outline: 2px solid var(--primary-focus);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-dark);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #014d26;
}

.btn-secondary {
    background-color: var(--canvas);
    color: var(--primary-dark);
    border: 1px solid var(--hairline);
}

.btn-secondary:hover {
    background-color: var(--canvas-parchment);
}

/* ==========================================================================
   TÁBLÁZATOK (PRÉMIUM MINIMALISTA RÁCS)
   ========================================================================== */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--canvas);
    margin: 24px 0 36px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

th {
    background: rgba(2, 102, 52, 0.03);
    color: var(--primary-dark);
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--hairline);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
    color: var(--text-main);
    vertical-align: top;
    line-height: 1.45;
}

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

tr:hover td {
    background-color: rgba(0, 0, 0, 0.015);
}

/* --- UI BADGE & CODE TOKENS --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

.badge-primary {
    background-color: rgba(146, 192, 31, 0.16);
    color: var(--primary-dark);
}

.badge-secondary {
    background-color: #f1f2f4;
    color: var(--text-muted-dark);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.code-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background-color: #f1f2f4;
    padding: 3px 7px;
    border-radius: var(--radius-xs);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: inline-block;
}

/* ==========================================================================
   JOGI OLDALAK TARTALMA (LEGAL CONTENT)
   ========================================================================== */
.legal-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px;
    background: var(--canvas);
}

.legal-content h2 {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.28px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-dark);
    padding-bottom: 16px;
    margin-bottom: 28px;
}

.legal-content h3 {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.224px;
    color: var(--text-main);
    margin-top: 36px;
    margin-bottom: 14px;
}

.legal-content p {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: #4a5568;
}

.legal-content ul {
    margin-bottom: 24px;
    padding-left: 24px;
    font-size: 16px;
    color: #4a5568;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.55;
}

.legal-content strong {
    color: var(--text-main);
    font-weight: 600;
}

.legal-content a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.legal-content a:hover {
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.back-link-container {
    max-width: 860px;
    margin: 0 auto 20px auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.12px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   ROBUSZTUS, ÉJFÉKETE LÁBLÉC (APPLE DARK SURFACE + HIGH-DENSITY LINKS)
   ========================================================================== */
.main-footer {
    background-color: var(--surface-tile-dark);
    color: var(--text-on-dark);
    padding: 56px 24px 36px 24px;
    margin-top: auto;
    border-top: 3px solid var(--primary-dark);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
}

.footer-links a {
    color: var(--text-muted-on-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 2.0; /* Dense link relaxation */
    letter-spacing: -0.12px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-accent);
}

.footer-copy {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   LEBEGŐ OPÁLOS COOKIE BANNER (FROSTED GLASS EFFECT)
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 160%);
    width: calc(100% - 40px);
    max-width: 860px;
    background-color: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-float);
    z-index: 9998;
    padding: 24px 28px;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.4s ease, 
                visibility 0.4s;
}

.cookie-banner.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.cookie-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-icon {
    flex-shrink: 0;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 102, 52, 0.08);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
}

.cookie-content {
    flex-grow: 1;
}

.cookie-title {
    font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Titillium Web", sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.224px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.cookie-text {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.45;
    letter-spacing: -0.224px;
}

.cookie-text a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-dark);
}

.cookie-text a:hover {
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.cookie-actions {
    flex-shrink: 0;
}

/* ==========================================================================
   RESZPONZÍV TÖRÉSPONTOK (APPLE RESPONSIVE SPECIFICATION)
   ========================================================================== */
@media (max-width: 834px) {
    header {
        padding: 0 20px;
    }
    
    .container {
        padding: 0 16px 64px 16px;
    }

    .welcome-section {
        padding: 48px 16px 36px 16px;
    }

    .welcome-section h2 {
        font-size: 34px;
    }

    .welcome-section p {
        font-size: 17px;
    }

    .legal-content {
        padding: 32px 24px;
    }
}

@media (max-width: 640px) {
    .welcome-section h2 {
        font-size: 28px;
    }

    .cookie-banner {
        bottom: 12px;
        width: calc(100% - 24px);
        padding: 20px;
    }

    .cookie-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .cookie-icon {
        display: none;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-actions .btn {
        width: 100%;
    }
}