/* =============================================
   SOEP QR — Frontend Styles
   ============================================= */

:root {
    --soep-primary:       #800000;
    --soep-primary-light: #cc2200;
    --soep-dark:          #2d3436;
    --soep-gray:          #636e72;
    --soep-light:         #fdf5f5;
    --soep-border:        #e8d0d0;
    --soep-white:         #ffffff;
    --soep-radius:        12px;
    --soep-shadow:        0 4px 24px rgba(128,0,0,0.10);
}

.soep-qr-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 32px auto;
    background: var(--soep-white);
    border-radius: 20px;
    box-shadow: var(--soep-shadow);
    overflow: hidden;
    border: 1px solid var(--soep-border);
}

/* ── HEADER ── */
.soep-qr-header {
    background: linear-gradient(135deg, var(--soep-primary) 0%, var(--soep-primary-light) 100%);
    color: white;
    padding: 28px 32px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.soep-qr-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.soep-qr-header h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
}
.soep-qr-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.85;
    color: white !important;
}

/* ── BODY LAYOUT ── */
.soep-qr-body {
    display: flex;
    gap: 0;
}
.soep-qr-form-col {
    flex: 1;
    padding: 24px;
    border-right: 1px solid var(--soep-border);
    min-width: 0;
}
.soep-qr-preview-col {
    width: 300px;
    flex-shrink: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ── TABS ── */
.soep-qr-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--soep-border);
    padding-bottom: 0;
}
.soep-tab {
    background: none;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--soep-gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.soep-tab.active {
    color: var(--soep-primary);
    border-bottom-color: var(--soep-primary);
}
.soep-tab:hover {
    color: var(--soep-primary);
}

/* ── PANELS ── */
.soep-qr-panel {
    display: none;
}
.soep-qr-panel.active {
    display: block;
}

/* ── FORM ELEMENTS ── */
.soep-qr-wrap label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--soep-dark);
    margin: 12px 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.soep-qr-wrap label:first-child {
    margin-top: 0;
}
.soep-qr-wrap input[type="text"],
.soep-qr-wrap input[type="url"],
.soep-qr-wrap input[type="email"],
.soep-qr-wrap input[type="tel"],
.soep-qr-wrap select,
.soep-qr-wrap textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--soep-border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--soep-dark);
    background: var(--soep-light);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.soep-qr-wrap input[type="text"]:focus,
.soep-qr-wrap input[type="url"]:focus,
.soep-qr-wrap input[type="email"]:focus,
.soep-qr-wrap input[type="tel"]:focus,
.soep-qr-wrap select:focus,
.soep-qr-wrap textarea:focus {
    border-color: var(--soep-primary);
    box-shadow: 0 0 0 3px rgba(128,0,0,0.12);
    background: white;
}
.soep-qr-wrap textarea {
    resize: vertical;
    min-height: 80px;
}
.soep-qr-wrap small {
    font-size: 0.78rem;
    color: var(--soep-gray);
    display: block;
    margin-top: 4px;
}

/* ── FIELD GROUPS ── */
.soep-field-group + .soep-field-group,
.soep-field-group {
    animation: soepFadeIn 0.2s ease;
}
@keyframes soepFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── BODY STYLE GRID ── */
.soep-body-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.soep-body-option {
    border: 2px solid var(--soep-border);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--soep-gray);
    transition: all 0.18s;
    user-select: none;
}
.soep-body-option:hover {
    border-color: var(--soep-primary-light);
    color: var(--soep-primary);
}
.soep-body-option.active {
    border-color: var(--soep-primary);
    background: rgba(108,92,231,0.07);
    color: var(--soep-primary);
    font-weight: 600;
}

/* ── COLOR ROW ── */
.soep-color-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}
.soep-color-row > div {
    flex: 1;
}
.soep-qr-wrap input[type="color"] {
    width: 100%;
    height: 38px;
    border: 1.5px solid var(--soep-border);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: var(--soep-white);
}
.soep-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    margin-top: 8px !important;
}
.soep-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--soep-primary);
}
.soep-qr-wrap input[type="range"] {
    width: calc(100% - 60px);
    accent-color: var(--soep-primary);
    vertical-align: middle;
}
#soep-size-label {
    font-size: 0.82rem;
    color: var(--soep-primary);
    font-weight: 600;
    margin-left: 8px;
}

/* ── GENERATE BUTTON ── */
.soep-qr-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background: linear-gradient(135deg, var(--soep-primary) 0%, var(--soep-primary-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 16px rgba(128,0,0,0.3);
    letter-spacing: 0.3px;
}
.soep-qr-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.soep-qr-btn:active {
    transform: translateY(0);
}
.soep-qr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── PREVIEW BOX ── */
.soep-qr-preview-box {
    width: 240px;
    height: 240px;
    border: 2px dashed var(--soep-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soep-light);
    transition: border-color 0.3s;
    overflow: hidden;
}
.soep-qr-preview-box.has-qr {
    border-style: solid;
    border-color: var(--soep-primary-light);
    background: white;
}
.soep-qr-placeholder {
    text-align: center;
    color: #b2bec3;
}
.soep-qr-placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
}
.soep-qr-placeholder p {
    font-size: 0.82rem;
    margin: 0;
    color: #b2bec3;
}
#soep-qr-img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
}

/* ── DOWNLOAD BUTTONS ── */
.soep-qr-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.soep-dl-btn {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}
.soep-dl-png {
    background: var(--soep-primary);
    color: white;
}
.soep-dl-png:hover { opacity: 0.87; }
.soep-dl-svg {
    background: var(--soep-light);
    color: var(--soep-primary);
    border: 1.5px solid var(--soep-primary);
}
.soep-dl-svg:hover {
    background: rgba(108,92,231,0.07);
}

/* ── INFO / ERROR ── */
.soep-qr-info {
    width: 100%;
    text-align: center;
}
.soep-qr-info small {
    color: var(--soep-gray);
    word-break: break-all;
    font-size: 0.75rem;
}
.soep-error {
    color: #e17055;
    font-size: 0.85rem;
    padding: 8px;
    text-align: center;
}

/* ── FOOTER ── */
.soep-qr-footer {
    padding: 14px 32px;
    background: var(--soep-light);
    border-top: 1px solid var(--soep-border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--soep-gray);
}

/* ── UTILITIES ── */
.soep-hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .soep-qr-body {
        flex-direction: column;
    }
    .soep-qr-form-col {
        border-right: none;
        border-bottom: 1px solid var(--soep-border);
    }
    .soep-qr-preview-col {
        width: 100%;
    }
    .soep-qr-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    .soep-body-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .soep-color-row {
        flex-wrap: wrap;
    }
}
