/* vigo — Navion-CD: schwarz, weiß, brand-green Akzent.
 * Inter-Font, modern, luftig, pill-CTAs.
 */

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

:root {
    --brand-black:       #000000;
    --brand-green:       #22C28A;
    --brand-green-dark:  #18A878;
    --brand-green-soft:  #E9F8F1;

    --text:              #111827;
    --text-muted:        #6B7280;
    --text-light:        #9CA3AF;

    --bg:                #FAFAFA;
    --card:              #FFFFFF;
    --border:            #ECECEC;
    --border-strong:     #D1D5DB;

    --error-bg:          #FEE2E2;
    --error-fg:          #991B1B;

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 2px 8px rgba(0,0,0,.05);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.08);

    --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 12px 0;
}
h1 { font-size: 36px; line-height: 1.15; }
h2 { font-size: 22px; }
p  { margin: 0 0 12px 0; }

a { color: var(--text); }
a:hover { color: var(--brand-green-dark); }

/* ============================================
   Header / Wordmark
   ============================================ */
header.site {
    background: rgba(255,255,255,.85);
    border-bottom: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    text-decoration: none;
    color: var(--text);
}
.wordmark-text {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.04em;
}
.wordmark-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand-green);
    display: inline-block;
}
.tagline {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   Main / Hero
   ============================================ */
main {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}
.hero {
    text-align: center;
    margin-bottom: 32px;
}
.hero h1 {
    background: linear-gradient(180deg, #111 0%, #555 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .lead {
    color: var(--text-muted);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto;
}

/* ============================================
   Card / Form
   ============================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.field-group {
    margin-bottom: 22px;
}
.field-group:last-child { margin-bottom: 0; }

.field-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text);
}
.field-label .hint {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
}
.hint {
    color: var(--text-muted);
    font-size: 13px;
}
.hint.subtle {
    margin-top: 8px;
}

input[type="text"], select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px var(--brand-green-soft);
}

/* ============================================
   Goals-Liste
   ============================================ */
#goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.goal-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.goal-num {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-green-soft);
    color: var(--brand-green-dark);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.goal-row input { flex: 1 1 auto; }
.goal-remove {
    flex: 0 0 36px;
    visibility: hidden; /* per JS sichtbar gesetzt, sobald > MIN_GOALS Zeilen existieren */
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary, .btn-ghost, .btn-icon {
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--brand-black);
    color: #fff;
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    position: relative;
    min-width: 200px;
}
.btn-primary:hover {
    background: var(--brand-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.btn-primary:disabled,
.btn-primary.is-loading {
    opacity: .85;
    cursor: progress;
    transform: none;
}
.btn-primary.is-loading .btn-label { opacity: .6; }
.btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    display: none;
    animation: spin 0.8s linear infinite;
}
.btn-primary.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
}
.btn-ghost:hover {
    border-color: var(--brand-green);
    color: var(--brand-green-dark);
    background: var(--brand-green-soft);
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}
.btn-icon:hover {
    background: var(--error-bg);
    color: var(--error-fg);
    border-color: var(--error-fg);
}

/* ============================================
   Result-Karte
   ============================================ */
.result-image-wrap {
    background: #f0f0f0;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}
#result-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   Progress-Overlay über Result-Image
   ============================================ */
.result-image-wrap { position: relative; }
.progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(2px);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}
.progress-overlay.hidden { display: none; }
.progress-spinner {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: var(--brand-green);
    animation: spin 0.9s linear infinite;
}
.progress-status {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    text-align: center;
    padding: 0 16px;
}

/* ============================================
   Edit-Section unter Result
   ============================================ */
.edit-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.edit-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.edit-row input {
    flex: 1 1 auto;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.edit-row input:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px var(--brand-green-soft);
}
.edit-row .btn-primary {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 12px 24px;
}
.edit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.chip {
    background: #f4f4f4;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.chip:hover {
    background: var(--brand-green-soft);
    border-color: var(--brand-green);
    color: var(--brand-green-dark);
}

/* ============================================
   Error-Box
   ============================================ */
.error-box {
    background: var(--error-bg);
    color: var(--error-fg);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.hidden { display: none !important; }

/* ============================================
   Footer
   ============================================ */
.site-foot {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    padding: 20px;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    main { padding: 32px 16px 64px; }
    .card { padding: 20px; }
    h1 { font-size: 28px; }
    .btn-primary { width: 100%; min-width: 0; }
    .result-actions { flex-direction: column; }
    .result-actions .btn-primary,
    .result-actions .btn-ghost { width: 100%; }
    .edit-row { flex-direction: column; }
    .edit-row .btn-primary { width: 100%; }
}
