:root {
    color-scheme: light;
    font-family: "Inter", "Segoe UI", sans-serif;
    background: #f5fbff;
    color: #102a43;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background-image: radial-gradient(circle at top left, rgba(79, 169, 255, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(245, 124, 0, 0.14), transparent 22%);
}

.page {
    width: min(100%, 760px);
}

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.6rem);
    letter-spacing: -0.03em;
    color: #334e68;
}

.hero p {
    margin: 16px auto 0;
    max-width: 620px;
    color: #556a78;
    line-height: 1.75;
    font-size: 1rem;
}

.card {
    background: white;
    border: 1px solid rgba(32, 52, 76, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
    padding: 28px;
}

.section {
    display: grid;
    gap: 24px;
}

fieldset {
    border: 1px solid rgba(217, 83, 79, 0.18);
    border-radius: 14px;
    background: #fff7f6;
    padding: 20px;
}

legend {
    font-weight: 700;
    color: #d9534f;
    padding: 0 12px;
}

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

label {
    display: grid;
    gap: 10px;
    font-size: 0.98rem;
    color: #334e68;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #ffffff;
    color: #102a43;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    border-color: #4f9cff;
    box-shadow: 0 0 0 4px rgba(79, 156, 255, 0.16);
}

.input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
}

.input-group input:first-child {
    width: 100%;
}

.input-group .remove-btn {
    width: 38px;
}

.hint {
    margin: 20px 0 0;
    color: #627d98;
    line-height: 1.75;
}

.button-row {
    display: grid;
    gap: 12px;
}

.add-btn,
.submit-btn,
.remove-btn {
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.add-btn {
    background: #2e7d32;
    color: white;
    padding: 12px 16px;
    font-size: 1rem;
}

.submit-btn {
    background: linear-gradient(135deg, #d9534f 0%, #c62828 100%);
    color: white;
    padding: 14px 18px;
    font-size: 1rem;
}

.remove-btn {
    background: #f5f6f8;
    color: #495057;
    border: 1px solid #d8dee6;
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.remove-btn::before {
    content: "\00d7";
    font-size: 1.05rem;
    color: #495057;
    position: absolute;
}

.add-btn:hover,
.submit-btn:hover,
.remove-btn:hover {
    opacity: 0.94;
    transform: translateY(-1px);
}

@media (max-width: 740px) {
    .grid-2,
    .input-group {
        grid-template-columns: 1fr;
    }

    .input-group .remove-btn {
        width: 100%;
    }
}

#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 7px solid #e5efff;
    border-top-color: #d9534f;
    border-radius: 999px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 1rem;
    color: #334e68;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
