* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #fff;
    color: #222;

    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    width: 320px;
}


.logo-wrapper {
    position: relative;
    display: inline-block;
}

h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.tagline {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 1.3rem;
    color: #666;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.fridge-button {
    position: fixed;
    top: 86px;
    left: 50%;
    transform: translateX(-50%);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #222;
    border-radius: 6px;

    color: #222;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    background: #fff;
}

.fridge-button:hover,
.fridge-button:focus {
    background: #222;
    color: #fff;
}

@media (max-width: 600px) {
    .tagline {
        font-size: 0.9rem;
    }

    .fridge-button {
        top: 78px;
        min-height: 38px;
        font-size: 0.82rem;
        padding: 0 14px;
    }
}

.coming-soon {
    margin-top: -70px;
    white-space: nowrap;
}

.page-content {
    gap: 14px;
    text-align: center;
}

.page-logo {
    width: 220px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0;
}

.back-link {
    margin-top: 12px;
    color: #666;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus {
    color: #222;
    text-decoration: underline;
}

.form-page {
    min-height: 100vh;
    height: auto;
    align-items: flex-start;
    padding: 24px 16px 40px;
    background: #f7f7f7;
}

.form-container,
.admin-container {
    width: 100%;
    max-width: 720px;
}

.book-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.form-title {
    padding: 22px 18px;
    border-top: 8px solid #222;
    border-radius: 8px;
    background: #fff;
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.25;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.form-section h2 {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.3;
}

.option-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
}

.option-row input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.option-transliteration {
    color: #444;
}

textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.search-input,
.text-label input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.search-results {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-result-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
}

.search-result-button:hover,
.search-result-button:focus {
    border-color: #222;
}

.empty-state {
    color: #666;
    font-size: 0.95rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #222;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.book-category-icon {
    position: relative;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid #222;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.book-category-icon::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #222;
    border-bottom: 2px solid #222;
    border-radius: 1px;
    transform: rotate(45deg);
}

.book-category .options-list {
    display: none;
}

.book-category.is-open .options-list {
    display: flex;
}

.book-category.is-open .book-category-icon {
    transform: rotate(180deg);
}

.text-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1rem;
}

.submit-button {
    align-self: flex-start;
    min-height: 42px;
    padding: 0 24px;
    border: 1px solid #222;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.submit-button:hover,
.submit-button:focus {
    background: #000;
}

.form-container .back-link {
    display: inline-block;
    margin-top: 20px;
}

.hidden-submit-form,
.hidden-submit-frame {
    display: none;
}

.form-message {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    color: #666;
}

.form-message[data-type="pending"]::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #222;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.form-message[data-type="success"] {
    color: #126b33;
}

.form-message[data-type="error"] {
    color: #b00020;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.admin-title {
    margin-bottom: 4px;
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0;
}

.admin-note {
    color: #666;
    line-height: 1.5;
}

.responses-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.response-card {
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.response-card h2 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 500;
}

.response-card dl {
    display: grid;
    grid-template-columns: minmax(120px, 170px) 1fr;
    gap: 8px 14px;
}

.response-card dt {
    color: #666;
}

.response-card dd {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .form-page {
        padding: 14px 10px 32px;
    }

    .form-title,
    .admin-title {
        font-size: 1.35rem;
    }

    .form-section,
    .response-card {
        padding: 14px;
    }

    .response-card dl {
        grid-template-columns: 1fr;
    }

    .response-card dt {
        margin-top: 6px;
    }
}
