body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.card {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-width: 560px;
}

.status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.status.ok {
    background: #d1fae5;
    color: #065f46;
}

.status.fail {
    background: #fee2e2;
    color: #991b1b;
}


:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

h1,
h2 {
    text-align: center;
    color: #0f172a;
}

.section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

/* Блок 1: Выбор камня */
.stone-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.stone-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.stone-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
}

.stone-card p {
    margin: 8px 0 0 0;
    font-weight: 500;
    font-size: 14px;
}

.stone-card input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
}

.stone-card.selected {
    border-color: var(--primary);
    background-color: #f0f5ff;
}

/* Блок 2: Загрузка фото */
.upload-zone {
    border: 2px dashed var(--border);
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: #fdfdfd;
}

.upload-zone:hover {
    border-color: var(--primary);
}

#file-input {
    display: none;
}

#preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 16px;
    display: none;
}

/* Кнопка и статус */
.btn-submit {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

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

.btn-submit:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.status.loading {
    background: #f1f5f9;
    color: #475569;
    display: block;
}

.status.success {
    background: #dcfce7;
    color: #15803d;
    display: block;
}

.status.error {
    background: #fee2e2;
    color: #b91c1c;
    display: block;
}

#result-container {
    margin-top: 16px;
    text-align: center;
    display: none;
}

#result-img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}