* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: #1e3a8a; }

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #4338ca, #6b21a8);
    color: #f5f5fb;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    transition: background .3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #0b1233, #1f1554, #2e0c4f);
}

h1, h2, h3 { margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 .5em; }
ul, li { list-style: none; padding: 0; margin: 0; }

.topbar { padding: 16px; }

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

body.dark-mode .topbar-inner {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .10);
}

.logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: 2px solid rgba(255, 255, 255, .35);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-title { flex: 1; text-align: center; }
.topbar-title h1 { font-size: 1.5rem; }
.subtitle { color: rgba(245, 245, 251, .75); font-size: .85rem; margin: 2px 0 0; }

#toggle-theme {
    flex-shrink: 0;
    background: rgba(255, 255, 255, .12);
    color: #f5f5fb;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
}

#toggle-theme:hover { background: rgba(255, 255, 255, .18); }

.container {
    padding: 8px 16px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.illustration {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.card {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    padding: 24px;
}

body.dark-mode .card {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .10);
}

.form-card { width: 100%; }
.form-card h2 { font-size: 1.2rem; margin-bottom: 18px; }

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.field label {
    font-size: .85rem;
    color: rgba(245, 245, 251, .75);
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
    color: #f5f5fb;
    font: inherit;
    font-size: .9rem;
    border-radius: 9999px;
    outline: none;
}

.field textarea {
    border-radius: 14px;
    resize: vertical;
    min-height: 100px;
}

.field input::placeholder,
.field textarea::placeholder { color: rgba(245, 245, 251, .55); }

.field input:focus,
.field textarea:focus {
    border-color: #fb923c;
    background: rgba(255, 255, 255, .08);
}

.counter {
    display: block;
    margin-top: 6px;
    text-align: right;
    color: rgba(245, 245, 251, .55);
    font-size: .8rem;
}

.counter.counter-warn { color: #ef4444; font-weight: 600; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    font-size: .85rem;
    color: rgba(245, 245, 251, .75);
    cursor: pointer;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: rgba(255, 255, 255, .12);
    color: #f5f5fb;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
}

.btn-submit:hover { background: rgba(255, 255, 255, .18); }

.messages { margin-bottom: 14px; }
.messages:empty { display: none; }

.msg-success {
    padding: 10px 16px;
    background: rgba(34, 197, 94, .15);
    border: 1px solid #22c55e;
    color: #22c55e;
    border-radius: 12px;
    text-align: center;
    font-size: .9rem;
}

.msg-error {
    padding: 10px 16px;
    background: rgba(239, 68, 68, .12);
    border: 1px solid #ef4444;
    color: #fca5a5;
    border-radius: 12px;
    font-size: .85rem;
    margin-bottom: 6px;
}

.msg-error-list { display: flex; flex-direction: column; gap: 6px; }

.messages-section h2 { font-size: 1.1rem; }



.post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.post { padding: 16px 20px; }

.post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, .18);
}

.post-name { font-weight: 700; }
.post-mail { color: #fb923c; font-size: .85rem; }

.post-date {
    margin-left: auto;
    color: rgba(245, 245, 251, .55);
    font-size: .8rem;
    font-style: italic;
}

.post-msg {
    white-space: pre-line;
    word-wrap: break-word;
    line-height: 1.6;
}

.pagination {
    text-align: center;
    margin: 16px 0;
    color: rgba(245, 245, 251, .75);
    font-size: .9rem;
}

.pagination a {
    color: #fb923c;
    text-decoration: none;
    padding: 0 4px;
}

.pagination a:hover { text-decoration: underline; }

@media (min-width: 480px) {
    .container { padding: 16px 24px 64px; gap: 28px; }

    .field {
        display: grid;
        
        align-items: center;
        gap: 14px;
    }

    .field label { margin: 0; text-align: left; }
    .field .counter { grid-column: 2 / 3; }

    .field:has(textarea) { align-items: start; }
    .field:has(textarea) label { padding-top: 10px; }

    .btn-submit { margin-left: 114px; width: calc(100% - 114px); }

    .illustration { width: 140px; height: 140px; }
}

@media (min-width: 960px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
        padding: 24px 32px 80px;
        gap: 32px;
    }

    .form-card { flex: 0 0 380px; }
    .messages-section { flex: 1; min-width: 0; }

    .form-card .field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .form-card .field label { text-align: left; font-size: .8rem; }
    .form-card .btn-submit { margin-left: 0; width: 100%; }
}

.hint {
  margin-top: 6px;
  font-family: monospace;
  font-size: 11px;
  min-height: 14px;
}
.error {
  color: #ff4d2e;
  font-weight: bold;
}
.ok {
  color: #43ff2a;
  font-weight: bold;
}