* { box-sizing: border-box; }

body {
    font-family: Arial;
    margin: 0;
    background: #f4f4f4;
}

/* HEADER */
header {
    background: #ff5733;
    color: white;
    text-align: center;
    padding: 20px;
}

/* BACK BUTTON FIX */
.back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: #34495e;
    color: white;
    padding: 10px 14px;
    text-decoration: none;
    border-radius: 8px;
    z-index: 9999;
}

/* LAYOUT */
.container {
    display: flex;
    gap: 20px;
    padding: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.survey-form,
.preview {
    background: white;
    width: 380px;
    padding: 20px;
    border-radius: 10px;
}

/* INPUT FIX */
input, select, textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}

/* BUTTON */
button {
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

button:disabled {
    background: gray;
}

/* ERROR */
.error {
    color: red;
    font-size: 12px;
}

/* TABLE */
.responses {
    padding: 20px;
}

.table-wrapper {
    max-width: 95%;
    margin: auto;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 10px;
    border: 1px solid #ccc;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    width: 320px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* MODAL HEADER */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-x {
    font-size: 24px;
    cursor: pointer;
}

/* BUTTON ROW */
.btn-row {
    display: flex;
    gap: 10px;
}

.danger {
    background: #e74c3c;
}

/* MOBILE */
@media (max-width: 600px) {
    .modal-content {
        width: 90%;
    }
}