/* =====================
   RESET & BASE
   ===================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    min-height: 100vh;
    padding: 16px;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================
   PAGE TITLE
   ===================== */
h1 {
    text-align: center;
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =====================
   FORM CARD
   ===================== */
form {
    background: #ffffff;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =====================
   FORM GROUP
   ===================== */
.form-group {
    margin-bottom: 14px;
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }
.form-group:nth-child(8) { animation-delay: 0.8s; }
.form-group:nth-child(9) { animation-delay: 0.9s; }
.form-group:nth-child(10) { animation-delay: 1.0s; }
.form-group:nth-child(11) { animation-delay: 1.1s; }
.form-group:nth-child(12) { animation-delay: 1.2s; }
.form-group:nth-child(13) { animation-delay: 1.3s; }
.form-group:nth-child(14) { animation-delay: 1.4s; }
.form-group:nth-child(15) { animation-delay: 1.5s; }
.form-group:nth-child(16) { animation-delay: 1.6s; }
.form-group:nth-child(17) { animation-delay: 1.7s; }
.form-group:nth-child(18) { animation-delay: 1.8s; }
.form-group:nth-child(19) { animation-delay: 1.9s; }
.form-group:nth-child(20) { animation-delay: 2.0s; }

@keyframes fadeInUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

label {
    display: block;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
    font-weight: 500;
}

label i {
    margin-right: 8px;
    color: #2c5364;
    transition: color 0.3s ease;
}

label:hover i {
    color: #1e3c4a;
}

/* =====================
   INPUT & SELECT
   ===================== */
input,
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:focus,
select:focus {
    outline: none;
    border-color: #2c5364;
    box-shadow: 0 0 0 3px rgba(44, 83, 100, 0.1);
    transform: translateY(-1px);
}

/* =====================
   SUBMIT BUTTON
   ===================== */
button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2c5364, #1e3c4a);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:hover {
    background: linear-gradient(135deg, #1e3c4a, #0f2027);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

button:active {
    background: #1e3c4a;
    transform: translateY(0);
}

/* =====================
   MODAL
   ===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: #ffffff;
    max-width: 480px;
    margin: 15% auto;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

.modal-content h2 {
    color: #2c5364;
    margin-bottom: 16px;
}

.modal-content button {
    background: linear-gradient(135deg, #28a745, #218838);
    margin-bottom: 10px;
}

.modal-content button:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
}

.modal-content a {
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modal-content a:hover {
    color: #c82333;
}

/* =====================
   SUMMARY MODAL
   ===================== */
.summary-modal {
    max-width: 600px !important;
    max-height: 70vh;
    overflow-y: auto;
}

.summary-content {
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.summary-content::-webkit-scrollbar {
    width: 4px;
}

.summary-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.summary-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.summary-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #2c5364;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.summary-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.summary-item strong {
    color: #2c5364;
    font-weight: 600;
    flex: 0 0 140px;
    margin-right: 12px;
}

.summary-item span {
    color: #495057;
    flex: 1;
    text-align: left;
    word-break: break-word;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.modal-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 120px;
}

.modal-buttons button:first-child {
    background: #6c757d;
    color: #ffffff;
}

.modal-buttons button:first-child:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.modal-buttons button:last-child {
    background: linear-gradient(135deg, #28a745, #218838);
    color: #ffffff;
}

.modal-buttons button:last-child:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
}

/* =====================
   FORM BUTTONS
   ===================== */
.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.reset-btn {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: #ffffff !important;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c82333, #a02622) !important;
    transform: translateY(-2px);
}

/* =====================
   DESKTOP IMPROVEMENT
   ===================== */
@media (min-width: 768px) {
    body {
        padding: 40px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    form {
        max-width: 600px;
        padding: 30px;
    }

    .modal-content {
        max-width: 600px;
        padding: 30px;
    }

    .summary-modal {
        max-width: 550px !important;
        padding: 25px !important;
    }

    .form-buttons {
        gap: 16px;
    }
}
