:root {
    --brand: #b51e2b;
    --text: #20252b;
    --border: #d7dce2;
    --background: #f1f3f5;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 16px;
}

.header {
    background: white;
    padding: 22px;
    border-bottom: 4px solid var(--brand);
    text-align: center;
}

.brand {
    font-size: 32px;
    font-weight: bold;
}

.brand span {
    color: var(--brand);
}

.header p {
    margin: 8px 0 0;
}

.container {
    max-width: 1000px;
    margin: auto;
    padding: 20px;
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
}

h2 {
    margin: 0 0 18px;
    font-size: 21px;
}

.description {
    line-height: 1.6;
    color: #555;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field label {
    font-weight: 600;
}

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

input,
select,
button {
    font: inherit;
}

input:not([type="checkbox"]),
select {
    width: 100%;
    min-height: 48px;
    padding: 10px;
    border: 1px solid #b6bec7;
    border-radius: 7px;
    background: white;
    color: var(--text);
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.product-row,
.clothing-row {
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.quantity select {
    width: 65px;
    text-align: center;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f1f3f5;
    font-size: 24px;
}

.size-selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.confirmation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f4f5f6;
    border-radius: 8px;
    line-height: 1.5;
}

.confirmation input {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: white;
    border: 2px dashed #a3aab3;
    border-radius: 8px;
    touch-action: none;
    cursor: crosshair;
}

.secondary-button {
    margin-top: 15px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.submit-button {
    width: 100%;
    padding: 18px;
    background: var(--brand);
    color: white;
    border: 0;
    border-radius: 10px;
    font-size: 19px;
    font-weight: bold;
}

.summary-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.total {
    font-size: 18px;
    text-align: right;
}

.notice {
    background: #fff3cd;
    border: 1px solid #e0cc8a;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

footer {
    padding: 25px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .panel {
        padding: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .quantity {
        gap: 4px;
    }

    .quantity-btn {
        width: 42px;
    }

    .quantity select {
        width: 55px;
    }
}

.login-container {
    max-width: 470px;
    margin: 40px auto;
    padding: 15px;
}

.login-container .field {
    margin-bottom: 20px;
}

.login-error {
    background: #fff0f0;
    border: 1px solid #d88b8b;
    color: #a51d27;
    padding: 12px;
    border-radius: 7px;
    margin-bottom: 18px;
}

.logout-button {
    padding: 10px 16px;
    background: white;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 7px;
}

.delivery-message:empty {
    display: none;
}

.delivery-message {
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    font-size: 17px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.delivery-message.success {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #1b5e20;
}

.delivery-message.error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

.delivery-message.processing {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
}

.delivery-message button {
    margin-top: 20px;
}
