@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Rubik:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    color-scheme: light dark;
    --bg: #f7f1e5;
    --card-bg: #fffdf8;
    --text: #3a3733;
    --muted: #6f6a60;
    --accent: #892c4e;
    --accent-secondary: #4c7074;
    --border: #e2d9c8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

h1 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
}

.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.auth-card h1 {
    margin-top: 0;
    font-size: 1.6rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

label {
    font-size: 0.85rem;
    color: var(--muted);
}

input[type="email"] {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

button {
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

.message {
    background: #f6e9ee;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.topbar a {
    color: var(--accent);
    text-decoration: none;
}

.tool-page {
    max-width: 760px;
}

.progress {
    margin-bottom: 1rem;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.test-reset {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.test-reset button {
    margin-top: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.test-reset button:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.tool-card {
    display: block;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
}

.tool-card h2 {
    margin: 0 0 0.5rem;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--accent);
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.tool-card--soon {
    opacity: 0.7;
    cursor: default;
}

.tool-card--soon .badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--border);
    color: var(--muted);
    font-size: 0.75rem;
}

.chat {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    max-height: 55vh;
    overflow-y: auto;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-line;
}

.chat-bubble--assistant {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--border);
}

.chat-bubble--user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
}

.chat-bubble--error {
    align-self: center;
    background: #f6e9ee;
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.85rem;
}

.chat-bubble--typing {
    opacity: 0.6;
    font-style: italic;
}

.chat-form {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.chat-form textarea {
    flex: 1;
    resize: none;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.chat-form button {
    margin-top: 0;
    align-self: flex-end;
}

.result-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.result-form h2 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.25rem;
}

.result-form h2:first-child {
    margin-top: 0;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.result-actions button {
    margin-top: 0;
}

.print-only {
    display: none;
}

.ikigai-diagram {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ikigai-card,
.ikigai-statement {
    padding: 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.ikigai-card p,
.ikigai-statement p {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
}

.ikigai-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.ikigai-card--liebe { grid-column: 1; grid-row: 1; }
.ikigai-card--faehigkeit { grid-column: 3; grid-row: 1; }
.ikigai-card--weltbedarf { grid-column: 1; grid-row: 2; }
.ikigai-card--bezahlung { grid-column: 3; grid-row: 2; }

.ikigai-statement {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: var(--accent);
    border-color: var(--accent);
}

.ikigai-statement .ikigai-card-label {
    color: rgba(255, 255, 255, 0.75);
}

.ikigai-statement p {
    color: #fff;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
}

@media (max-width: 640px) {
    .ikigai-diagram {
        grid-template-columns: 1fr;
    }

    .ikigai-card--liebe,
    .ikigai-card--faehigkeit,
    .ikigai-card--weltbedarf,
    .ikigai-card--bezahlung,
    .ikigai-statement {
        grid-column: 1;
        grid-row: auto;
    }
}

.ikigai-details {
    margin-bottom: 1.5rem;
}

.ikigai-details h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 600;
    margin: 1.1rem 0 0.35rem;
}

.ikigai-details h3:first-child {
    margin-top: 0;
}

.ikigai-details p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.wunschkunde-card {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin-bottom: 1.5rem;
}

.wunschkunde-card h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.wunschkunde-card dl {
    margin: 1rem 0 0;
}

.wunschkunde-card dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin-top: 0.85rem;
}

.wunschkunde-card dd {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.wunschkunde-card ul {
    margin: 0;
    padding-left: 1.2rem;
}

.one-thing-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    margin-bottom: 1.5rem;
}

.one-thing-card .ikigai-card-label {
    color: rgba(255, 255, 255, 0.75);
}

.one-thing-card p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.2rem;
    margin: 0.35rem 0 0;
}

.pillars-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .pillars-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .pillars-columns {
        grid-template-columns: 1fr;
    }
}

.pillar-column {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.pillar-column h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--accent);
    margin: 0 0 0.4rem;
}

.pillar-reason {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 0.6rem;
}

.pillar-column ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.result-edit {
    margin-bottom: 1.5rem;
}

.result-edit summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

@media print {
    .no-print,
    .topbar,
    .back-link,
    .tool-page > h1 {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    body {
        background: #fff;
    }

    .print-title {
        margin-bottom: 1.25rem;
    }

    .print-subtitle {
        color: #555;
        font-size: 0.85rem;
    }

    .ikigai-card,
    .ikigai-statement,
    .wunschkunde-card,
    .pillar-column,
    .one-thing-card {
        break-inside: avoid;
        background: #fff !important;
        border: 1px solid #ccc !important;
    }

    .ikigai-diagram {
        break-inside: avoid;
    }

    .ikigai-details h3,
    .ikigai-details p {
        break-inside: avoid;
    }

    .ikigai-statement p,
    .one-thing-card p {
        color: var(--accent) !important;
    }

    .ikigai-statement .ikigai-card-label,
    .one-thing-card .ikigai-card-label {
        color: #777 !important;
    }

    .pillars-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}

.result-actions button[type="button"] {
    background: var(--accent-secondary);
}

.script-form {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    margin-top: 0.75rem;
}

.script-form label {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.script-form select,
.script-form input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    margin-top: 0.2rem;
}

.script-form button {
    margin-top: 0.85rem;
}

.saeule-filter {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.saeule-filter label {
    font-size: 0.85rem;
    color: var(--muted);
}

.saeule-filter select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
}

.idea-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.idea-card {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.idea-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    gap: 0.5rem;
}

.idea-meta {
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
    background: var(--border);
    color: var(--muted);
}

.status-badge--idee {
    background: #f6e9ee;
    color: var(--accent);
}

.status-badge--skript_fertig {
    background: #e7eef0;
    color: var(--accent-secondary);
}

.status-badge--gefilmt {
    background: var(--accent);
    color: #fff;
}

.idea-card h3 {
    margin: 0 0 0.3rem;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 1.05rem;
}

.idea-card .hook {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.idea-card details {
    margin-top: 0.75rem;
}

.idea-card summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.85rem;
}

.script-text {
    white-space: pre-wrap;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem;
    margin: 0.6rem 0;
}

.status-form {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.6rem;
}

.status-form select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
}

.status-form button {
    margin-top: 0;
}
