:root {
    --sc-primary: #570B23;
    --sc-primary-hover: #A52051;
    --sc-text: #0D0C0F;
    --sc-muted: #6b7280;
    --sc-border: #e2e5e9;
    --sc-background: #f4f6f9;
    --sc-white: #ffffff;
    --sc-danger: #b42318;
    --sc-success: #18794e;
    --sc-radius: 12px;
    --sc-shadow: 0 8px 30px rgba(20, 30, 50, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--sc-background);
    color: var(--sc-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

[hidden] {
    display: none !important;
}

.page-container {
    width: min(100% - 32px, 1000px);
    margin: 0 auto;
    padding: 32px 0;
}

.page-header {
    margin-bottom: 24px;
    width: 100% !important;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    color: var(--sc-primary);
    text-decoration: none;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.brand-subtitle {
    color: var(--sc-muted);
    font-size: 12px;
}

.header-description {
    color: var(--sc-muted);
    text-align: right;
    font-size: 13px;
}

.form-card {
    overflow: hidden;
    background: var(--sc-white);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
}

.form-heading {
    padding: 32px;
    border-bottom: 1px solid var(--sc-border);
}

.form-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.2;
    text-align: center;
    color: var(--sc-primary);
}

.form-heading p {
    margin: 0;
    color: var(--sc-muted);
    text-align: center;
}

.required-mark {
    color: var(--sc-danger);
    font-weight: 700;
}

.form-section {
    padding: 30px 32px;
    border-bottom: 1px solid var(--sc-border);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.section-number {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    background: #F8EAF0;
    border-radius: 10px;
    color: #570B23;
    font-size: 13px;
    font-weight: 800;
}

.section-heading h2 {
    margin: 0 0 4px;
    font-size: 19px;
}

.section-heading p {
    margin: 0;
    color: var(--sc-muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.form-field {
    min-width: 0;
}

.full-width {
    grid-column: 1 / -1;
}

.form-field > label:not(.checkbox-card):not(.image-drop-area) {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.form-field input:not([type="checkbox"]):not([type="file"]),
.form-field select,
.form-field textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--sc-text);
    background: var(--sc-white);
    border: 1px solid #d4d8df;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field textarea {
    min-height: 100px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3px rgba(165, 32, 81, 0.16);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #9ca3af;
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--sc-muted);
    font-size: 12px;
}

.input-action-group {
    display: flex;
    gap: 8px;
}

.input-action-group input {
    flex: 1;
    min-width: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    transition: background 0.2s, border-color 0.2s;
}

.button-primary {
    min-width: 210px;
    background: var(--sc-primary-hover);
    color: #FFFFFF;
}

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

.button-secondary {
    background: #fff;
    color: var(--sc-text);
    border-color: #d4d8df;
}

.button-secondary:hover:not(:disabled) {
    background: #f8f9fb;
    border-color: #aeb4bd;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--sc-border);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.checkbox-card:hover {
    border-color: #A52051;
    background: #FDF7FA;
}

.checkbox-card input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--sc-primary);
    cursor: pointer;
}

.checkbox-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

.checkbox-copy strong {
    font-size: 13px;
}

.checkbox-copy small {
    color: var(--sc-muted);
    font-size: 12px;
}

.batch-card {
    margin-bottom: 16px;
    padding: 20px;
    background: #fafbfc;
    border: 1px solid var(--sc-border);
    border-radius: 10px;
}

.batch-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.batch-title {
    margin: 0;
    font-size: 15px;
}

.remove-batch {
    padding: 5px 9px;
    background: #fff;
    color: var(--sc-danger);
    border: 1px solid #f0c5c2;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.remove-batch:hover {
    background: #fff3f2;
}

#add-batch {
    margin-top: 2px;
}

.image-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px 20px;
    background: #fcfcfd;
    border: 2px dashed #d4d8df;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.image-drop-area:hover,
.image-drop-area.drag-over {
    background: #FDF7FA;
    border-color: var(--sc-primary);
}

.image-drop-area strong {
    font-size: 14px;
}

.image-drop-area > span:not(.upload-icon) {
    color: var(--sc-muted);
    font-size: 13px;
}

.image-drop-area small {
    color: var(--sc-muted);
    font-size: 12px;
}

.upload-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: #F8EAF0;
    border-radius: 50%;
    color: #570B23;
    font-size: 25px;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.image-preview-item {
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--sc-border);
    border-radius: 8px;
    background: #f7f7f7;
}

.image-preview-item img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.image-preview-name {
    overflow: hidden;
    padding: 7px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    padding: 0;
    background: rgba(20, 20, 20, 0.8);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 17px;
}

.image-preview-remove:hover {
    background: #a61b1b;
}

.rules-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-footer {
    display: block;
    padding: 28px 32px;
    margin: 0;
    width: 100%;
}

.form-footer-note {
    max-width: 100%;
    margin: 0;
    color: var(--sc-muted);
    font-size: 15px;
}

.form-alert {
    margin: 20px 32px 0;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 14px;
}

.form-alert-success {
    color: var(--sc-success);
    background: #ecfdf3;
    border-color: #abefc6;
}

.form-alert-error {
    color: var(--sc-danger);
    background: #fef3f2;
    border-color: #fecdca;
}

.field-invalid {
    border-color: var(--sc-danger) !important;
    box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.08) !important;
}

.button-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #570B23;
    border-radius: 50%;
    animation: sc-spin 0.7s linear infinite;
}

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

.page-footer {
    padding: 20px 0 0;
    color: var(--sc-muted);
    text-align: center;
    font-size: 12px;
}

.page-footer p {
    margin: 0;
}

@media (max-width: 700px) {
    .page-container {
        width: min(100% - 20px, 1000px);
        padding: 16px 0;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }

    .header-description {
        text-align: left;
    }

    .form-heading {
        padding: 24px 20px;
    }

    .form-section {
        padding: 24px 20px;
    }

    .section-heading {
        gap: 10px;
        margin-bottom: 20px;
    }

    .section-number {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .section-heading h2 {
        font-size: 17px;
    }

    .form-grid,
    .rules-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .input-action-group {
        flex-wrap: wrap;
    }

    .input-action-group input {
        flex-basis: 100%;
    }

    .input-action-group .button {
        width: 100%;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 24px 20px;
    }

    .button-primary {
        width: 100%;
    }

    .form-alert {
        margin: 16px 20px 0;
    }

    .batch-card {
        padding: 15px;
    }
}
