/* My Cellar of Wine — Ask The Expert */

:root {
    --wine-burgundy: #722f37;
    --wine-dark: #4a0e0e;
    --wine-deep: #2d1215;
    --gold: #c9a962;
    --gold-light: #e8d5a3;
    --cream: #faf7f2;
    --text-primary: #2c1810;
    --text-muted: #6b5344;
    --success: #2d6a4f;
    --error: #9b2226;
    --border: rgba(114, 47, 55, 0.2);
    --shadow: 0 24px 48px rgba(45, 18, 21, 0.18);
    --radius: 16px;
    --font-display: Georgia, 'Times New Roman', serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-primary);
    background:
        radial-gradient(ellipse at top left, rgba(201, 169, 98, 0.15), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(114, 47, 55, 0.2), transparent 55%),
        linear-gradient(160deg, var(--wine-deep) 0%, var(--wine-dark) 45%, var(--wine-burgundy) 100%);
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.card {
    width: 100%;
    max-width: 580px;
    background: var(--cream);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.card__header {
    background: linear-gradient(135deg, var(--wine-dark), var(--wine-burgundy));
    color: var(--cream);
    padding: 36px 32px 28px;
    text-align: center;
}

.card__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
}

.card__title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.3;
}

.card__note {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--gold-light);
    font-style: italic;
}

.card__divider {
    width: 64px;
    height: 3px;
    background: var(--gold);
    margin: 18px auto 0;
    border-radius: 2px;
}

.card__body {
    padding: 32px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form__required {
    color: var(--wine-burgundy);
}

.form__optional {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form__input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form__input:focus {
    outline: none;
    border-color: var(--wine-burgundy);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.15);
}

.form__input:disabled {
    background: #f0ebe4;
    cursor: not-allowed;
    opacity: 0.8;
}

.form__input--error {
    border-color: var(--error);
}

.form__select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23722f37' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form__textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form__textarea:focus {
    outline: none;
    border-color: var(--wine-burgundy);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.15);
}

.form__textarea:disabled {
    background: #f0ebe4;
    cursor: not-allowed;
    opacity: 0.8;
}

.form__textarea--error {
    border-color: var(--error);
}

.form__error {
    font-size: 0.8rem;
    color: var(--error);
    min-height: 1rem;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.form__btn {
    flex: 1;
    min-width: 140px;
    padding: 13px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.form__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.form__btn--primary {
    background: linear-gradient(135deg, var(--wine-burgundy), var(--wine-dark));
    color: var(--cream);
}

.form__btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #8a3842, var(--wine-burgundy));
    transform: translateY(-1px);
}

.form__btn--close {
    background: #e55353;
    color: #fff;
}

.form__btn--close:hover:not(:disabled) {
    background: #cc4242;
}

.message {
    display: none;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
    margin-bottom: 20px;
}

.message--visible {
    display: block;
}

.message--success {
    background: rgba(45, 106, 79, 0.12);
    color: var(--success);
    border: 1px solid rgba(45, 106, 79, 0.25);
}

.message--error {
    background: rgba(155, 34, 38, 0.1);
    color: var(--error);
    border: 1px solid rgba(155, 34, 38, 0.22);
}

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.loading--visible {
    display: flex;
}

.loading__spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--wine-burgundy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .card__header {
        padding: 28px 22px 22px;
    }

    .card__body {
        padding: 22px;
    }

    .form__actions {
        flex-direction: column;
    }

    .form__btn {
        width: 100%;
    }
}
