:root {
    --background: #f4f4f5;
    --surface: #ffffff;
    --surface-hover: #f3f3f4;

    --text: #171717;
    --text-muted: #606060;

    --border: #252525;
    --border-light: #d5d5d5;

    --primary: #404040;
    --primary-hover: #292929;

    --danger: #a62d2d;
    --danger-background: #fffafa;

    --focus: #4169e1;

    --small-radius: 8px;
    --medium-radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;

    margin: 0;
    padding: 32px;

    background: var(--background);
    color: var(--text);

    font-family: "Inter", Arial, sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Gesamte Anwendung */

.app {
    display: flex;
    flex-direction: column;

    width: min(100%, 1400px);
    min-height: calc(100vh - 64px);

    margin: 0 auto;

    overflow: hidden;

    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--medium-radius);

    box-shadow: 0 18px 50px rgb(0 0 0 / 8%);
}

/* Login-Ansicht */

.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    width: min(100%, 460px);

    margin: max(24px, 10vh) auto 0;
    padding: 48px 40px;

    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--medium-radius);

    box-shadow: 0 18px 50px rgb(0 0 0 / 8%);

    text-align: center;
}

.login-brand {
    margin: 0;

    font-size: 2.5rem;
    font-weight: 700;
}

.login-tagline {
    margin: 0 0 20px;

    color: var(--text-muted);
}

.login-privacy {
    max-width: 46ch;

    margin: 20px 0 0;

    color: var(--text-muted);

    font-size: 0.78rem;
    line-height: 1.55;
}

.login-privacy a {
    color: var(--text);
}

.login-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    width: 100%;

    margin-top: 36px;
    padding-top: 14px;

    border-top: 1px solid var(--border-light);

    font-size: 0.8rem;
}

.login-dev {
    color: var(--text-muted);
    font-weight: 600;
}

.login-links {
    display: flex;
    gap: 16px;
}

.login-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.login-links a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Textseiten (Datenschutz o. Ä.) */

.page {
    width: min(100%, 760px);

    margin: 0 auto;
    padding: 40px;

    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--medium-radius);

    box-shadow: 0 18px 50px rgb(0 0 0 / 8%);

    line-height: 1.65;
}

.page h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.page h2 {
    margin: 36px 0 8px;
    font-size: 1.2rem;
}

.page-lead {
    color: var(--text-muted);
}

.page-back {
    font-size: 0.85rem;
    font-weight: 600;
}

.page-table {
    width: 100%;

    margin: 16px 0;

    border-collapse: collapse;
    font-size: 0.9rem;
}

.page-table th,
.page-table td {
    padding: 10px 12px;

    border: 1px solid var(--border-light);
    text-align: left;
    vertical-align: top;
}

.page-table th {
    background: var(--surface-hover);
    font-weight: 600;
}

/* Kopfbereich */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 88px;
    padding: 20px 32px;

    border-bottom: 2px solid var(--border);
}

.brand {
    color: var(--text);

    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
}

.account {
    display: flex;
    align-items: center;
    gap: 20px;

    font-weight: 600;
}

/* Hauptbereich */

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 35%) minmax(0, 65%);

    flex: 1;
}

.ideas-panel,
.editor-panel {
    padding: 36px;
}

.ideas-panel {
    border-right: 2px solid var(--border);
}

/* Überschriften */

.panel-header,
.editor-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.panel-header {
    justify-content: space-between;
    margin-bottom: 28px;
}

.panel-header h1,
.editor-header h2 {
    margin: 0;

    font-size: 1.65rem;
}

/* Allgemeine Buttons */

.button {
    min-height: 48px;
    padding: 10px 20px;

    border: 2px solid var(--border);
    border-radius: var(--small-radius);

    background: var(--surface);
    color: var(--text);

    font-weight: 600;

    transition:
        background-color 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.button:hover {
    background: var(--surface-hover);
}

.button:active {
    transform: translateY(1px);
}

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

.button-primary:hover {
    background: var(--primary-hover);
}

.button-danger {
    border-color: var(--danger);

    background: var(--danger-background);
    color: var(--danger);
}

.button-danger:hover {
    background: #fff0f0;
}

.hidden {
    display: none;
}
/* Ideenliste */

.idea-list {
    display: grid;
    gap: 16px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.idea-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 112px;
    padding: 22px;

    border: 2px solid var(--border);
    border-radius: var(--small-radius);

    background: var(--surface);
    color: var(--text);

    text-align: left;

    transition:
        background-color 150ms ease,
        box-shadow 150ms ease;
}

.idea-card:hover {
    background: var(--surface-hover);
}

.idea-card-selected {
    background: var(--surface-hover);

    box-shadow: inset 5px 0 0 var(--primary);
}

.idea-title {
    padding-right: 16px;

    font-size: 1.1rem;
    font-weight: 600;
}

.status {
    flex-shrink: 0;

    padding: 8px 14px;

    border-radius: 999px;

    background: #e1e1e3;

    font-size: 0.85rem;
    font-weight: 500;
}

/* Formular */

.editor-header {
    margin-bottom: 32px;
}

.back-button {
    display: none;

    width: 44px;
    height: 44px;
    padding: 0;

    border: none;

    background: transparent;
    color: var(--text);

    font-size: 1.8rem;
}

.idea-form {
    display: grid;
    gap: 24px;
}

.form-field {
    display: grid;
    gap: 9px;
}

.form-field label {
    font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;

    border: 2px solid var(--border);
    border-radius: var(--small-radius);

    background: var(--surface);
    color: var(--text);
}

.form-field input,
.form-field select {
    min-height: 56px;
    padding: 12px 16px;
}

.form-field textarea {
    min-height: 190px;
    padding: 16px;

    resize: vertical;
}

.form-actions {
    display: grid;
    gap: 14px;
}

.form-actions .button {
    width: 100%;
}

/* Smartphone */

@media (max-width: 760px) {
    body {
        padding: 0;

        background: var(--surface);
    }

    .app {
        min-height: 100vh;

        border: none;
        border-radius: 0;

        box-shadow: none;
    }

    .topbar {
        display: none;
    }

    .workspace {
        display: block;
    }

    .ideas-panel,
    .editor-panel {
        min-height: 100vh;
        padding: 24px 18px;

        border: none;
    }

    .panel-header {
        position: sticky;
        top: 0;
        z-index: 10;

        margin: -24px -18px 22px;
        padding: 20px 18px 16px;

        background: var(--surface);
        border-bottom: 1px solid var(--border-light);
    }

    .panel-header h1,
    .editor-header h2 {
        font-size: 1.35rem;
    }

    .idea-card {
        min-height: 104px;
        padding: 20px;
    }

    /*
        Auf dem Smartphone wird zunächst nur
        die Ideenübersicht angezeigt.
    */

    .editor-panel {
        display: none;
    }

    /*
        JavaScript kann später app-state--editor
        auf das body-Element setzen.
    */

    .app-state--editor .ideas-panel {
        display: none;
    }

    .app-state--editor .editor-panel {
        display: block;
    }

    .back-button {
        display: inline-grid;
        place-items: center;
    }

    .editor-header {
        position: sticky;
        top: 0;
        z-index: 10;

        margin: -24px -18px 24px;
        padding: 16px 18px;

        background: var(--surface);
        border-bottom: 1px solid var(--border-light);
    }

    .form-field textarea {
        min-height: 170px;
    }
}