* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Nunito Sans", sans-serif;
}

:root {
    --brown-dark: #482817;
    --brown-primary: #af6900;
    --brown-light: #9e845c;
    --cream: #f5ebda;
    --gray-medium: #6b7280;
}

body {
    font-family: "Nunito Sans", sans-serif;
    background-color: var(--cream);
    color: var(--brown-dark);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    padding: 2rem 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--brown-dark);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.3s;
}

.back-button:hover {
    background: rgba(175, 105, 0, 0.05);
    color: var(--brown-primary);
}

h1 {
    font-family: "Libre Baskerville", serif;
    font-size: 2.25rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--brown-dark);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-medium);
}

/* Main Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
    align-items: start;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 380px 1fr;
    }
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Progress Card */
.progress-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(158, 132, 92, 0.2);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-medium);
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(158, 132, 92, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brown-primary);
    transition: width 0.3s;
}

/* Accordion Steps */
.accordion-step {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(158, 132, 92, 0.2);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    background: white;
    width: 100%;
    text-align: left;
}

.accordion-header:hover {
    background: rgba(175, 105, 0, 0.05);
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
    background: rgba(158, 132, 92, 0.2);
    color: var(--gray-medium);
}

.step-icon.complete {
    background: var(--brown-primary);
    color: white;
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--brown-dark);
}

.step-desc {
    font-size: 0.75rem;
    color: var(--gray-medium);
    margin-top: 0.125rem;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 2000px;
}

.accordion-body {
    padding: 1.1rem 1.5rem 1.5rem;
}

/* Form Controls */
.control-group {
    margin-bottom: 1rem;
}

.control-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-medium);
    margin-bottom: 0.5rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.template-card {
    position: relative;
    height: 112px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(158, 132, 92, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: rgba(175, 105, 0, 0.5);
    transform: scale(1.02);
}

.template-card.selected {
    border-color: var(--brown-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.template-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 0.5rem;
    font-size: 0.75rem;
    color: white;
    text-align: center;
}

.template-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: var(--brown-primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.template-card.selected .template-check {
    display: flex;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(158, 132, 92, 0.4);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: rgba(175, 105, 0, 0.5);
    background: rgba(175, 105, 0, 0.05);
}

.upload-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    color: var(--brown-primary);
}

.upload-preview {
    max-height: 128px;
    margin: 0 auto 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

input[type="file"] {
    display: none;
}

/* Slider */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(158, 132, 92, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brown-primary);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brown-primary);
    cursor: pointer;
    border: none;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-value {
    font-size: 0.75rem;
    color: var(--brown-primary);
}

/* Color Palette */
.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.color-button {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid rgba(158, 132, 92, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.color-button:hover {
    border-color: rgba(175, 105, 0, 0.5);
}

.color-button.selected {
    border-color: var(--brown-primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(175, 105, 0, 0.2);
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.toggle-button {
    padding: 0.625rem;
    border: 1px solid rgba(158, 132, 92, 0.4);
    background: white;
    color: var(--brown-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: "Nunito Sans", sans-serif;
    font-size: 0.875rem;
}

.toggle-button:hover {
    background: rgba(175, 105, 0, 0.05);
}

.toggle-button.active {
    background: var(--brown-primary);
    color: white;
    border-color: var(--brown-primary);
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid rgba(158, 132, 92, 0.4);
    border-radius: 8px;
    font-family: "Nunito Sans", sans-serif;
    resize: none;
    font-size: 0.875rem;
}

textarea:focus {
    outline: none;
    border-color: var(--brown-primary);
}

/* Info Box */
.info-box {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-top: 1rem;
}

.info-box.blue {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.info-box.amber {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.info-box.green {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

/* Section Divider */
.section-divider {
    border-top: 1px solid rgba(158, 132, 92, 0.2);
    padding-top: 1rem;
    margin-top: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brown-dark);
}

/* Action Buttons */
.action-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid rgba(175, 105, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: "Nunito Sans", sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--brown-primary);
    color: white;
    height: 48px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #9e5a00;
}

.btn-outline {
    background: white;
    color: var(--brown-dark);
    border: 1px solid rgba(158, 132, 92, 0.4);
    margin-top: 0.75rem;
}

.btn-outline:hover {
    background: rgba(175, 105, 0, 0.05);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    height: auto;
}

.btn-remove {
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-remove:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Preview */
.preview-card {
    background: red;
    background: white;
    border-radius: 16px;
    padding: 2rem 2rem 4rem 2rem;
    border: 1px solid rgba(158, 132, 92, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(158, 132, 92, 0.2);
    margin-bottom: 1.5rem;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-title h2 {
    font-family: "Libre Baskerville", serif;
    font-size: 1.5rem;
    color: var(--brown-dark);
    font-family: 'Nunito Sans';
    font-weight: 400;
}

.preview-canvas {
    background: #f9fafb;
    border-radius: 12px;
    height: calc(100vh - 294px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-container {
    position: relative;
    width: 387px;
    height: 306px;
    max-width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.label-layer {
    position: absolute;
    inset: 0;
}

.label-text-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.label-text {
    max-width: 80%;
    word-break: break-word;
    line-height: 1.4;
}

/* Product Name Overlay */
.label-product-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.label-product-name {
    color: white;
    font-size: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}


/* Guide Overlay */
.guide-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.guide-die-cut {
    position: absolute;
    inset: 0;
    border: 2px dashed #ef4444;
}

.guide-bleed {
    position: absolute;
    inset: 3%;
    border: 1px dashed #f59e0b;
}

.guide-safe {
    position: absolute;
    inset: 8% 12%;
    border: 1px dashed #10b981;
}

.guide-legend {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(158, 132, 92, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-line {
    width: 24px;
    height: 2px;
}

/* Small Toggles */
.inline-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.toggle-btn-small {
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(158, 132, 92, 0.4);
    background: white;
    color: var(--gray-medium);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s;
}

.toggle-btn-small.active {
    background: rgba(175, 105, 0, 0.1);
    border-color: var(--brown-primary);
    color: var(--brown-primary);
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Utility */
.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.label-side-warning-text-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;

    .label-left-warning-text {
        writing-mode: vertical-rl;
        text-align: center;
        font-size: 8px;
        color: white;
        line-height: 10px;
        left: 14px;
        position: relative;
    }

    .label-right-warning-text {
        writing-mode: vertical-rl;
        text-align: center;
        font-size: 6px;
        line-height: 8px;
        color: white;
        transform: rotate(180deg);
        right: 12px;
        position: relative;
        text-align: justify;
        padding: 12px 0;
    }
}