* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1a1a2e;
    font-size: 16px;
    line-height: 1.5;
}

h1, h3 {
    text-align: center;
    font-weight: 300;
}

h1 {
    padding: 50px 20px;
}

h3 {
    padding: 0 20px 40px;
}

.container {
    max-width: 990px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header / Top Row ===== */
.header {
    background-color: #2d3748;
    padding: 20px 0;
}

.top-row {
    display: flex;
    gap: 12px;
}

.autocomplete-wrapper {
    position: relative;
    flex: 1;
}

.top-input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    color: #2d3748;
    background-color: #fff;
    outline: none;
    transition: box-shadow 0.2s;
}

.top-input::placeholder {
    color: #a0aec0;
}

.top-input:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.4);
}

.top-input.input-error {
    background-color: #fed7d7;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.4);
}

/* ===== Error state for cards ===== */
.card.card-error {
    border-color: #f56565;
    background-color: #fff5f5;
}

.card-error .weight-input,
.card-error .dimension-input,
.card-error .cargo-weight,
.card-error .cargo-places {
    background-color: #fed7d7;
}

/* ===== Autocomplete Dropdown ===== */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: none;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #2d3748;
    transition: background 0.15s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f7fafc;
}

.autocomplete-item:first-child {
    background-color: #edf2f7;
}

.autocomplete-item .city-name {
    font-weight: 500;
}

.autocomplete-item .city-region {
    color: #a0aec0;
    font-size: 14px;
    margin-left: 4px;
}

/* ===== Main Content ===== */
.main-content {
    padding: 30px 0 40px;
}

.cards-row {
    display: flex;
    gap: 16px;
}

/* ===== Cards ===== */
.card {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 28px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card.card-active {
    border-color: #4299e1;
    box-shadow: 0 0 0 1px #4299e1;
}

.card:hover:not(.card-active) {
    border-color: #cbd5e0;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 24px;
}

.card-body {
    flex-grow: 1;
    justify-content: space-between;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Weight Input (small box) ===== */
.weight-input {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    display: inline-block;
    min-width: 120px;
    width: fit-content;
}

.weight-input label {
    display: block;
    font-size: 11px;
    color: #a0aec0;
    margin-bottom: 2px;
}

.weight-input input {
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 500;
    color: #2d3748;
    width: 60px;
    outline: none;
}

/* ===== Radio Group ===== */
.radio-group {
    display: flex;
    gap: 24px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #2d3748;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    display: inline-block;
    position: relative;
    transition: border-color 0.2s;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #4299e1;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #4299e1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== Description Input ===== */
.description-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    font-size: 16px;
    color: #2d3748;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.description-input::placeholder {
    color: #a0aec0;
}

.description-input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* ===== Cargo Dimensions ===== */
.dimensions-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.dimension-input {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    flex: 1;
    min-width: 200px;
}

.dimension-input label {
    display: block;
    font-size: 11px;
    color: #a0aec0;
    margin-bottom: 8px;
}

.dimension-fields {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimension-fields input {
    width: 40px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 500;
    color: #2d3748;
    text-align: center;
    outline: none;
}

.dimension-x {
    color: #cbd5e0;
    font-size: 16px;
}

.cargo-weight,
.cargo-places {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 80px;
}

.cargo-weight label,
.cargo-places label {
    display: block;
    font-size: 11px;
    color: #a0aec0;
    margin-bottom: 2px;
}

.cargo-weight input,
.cargo-places input {
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 500;
    color: #2d3748;
    width: 40px;
    outline: none;
}

/* ===== Submit Button ===== */
.submit-row {
    text-align: center;
    margin-top: 30px;
}

.btn-find {
    background-color: #48bb78;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 18px 60px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-find:hover {
    background-color: #38a169;
}

.btn-find:active {
    transform: scale(0.98);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 24px;
        padding: 30px 20px;
    }

    .top-row {
        flex-direction: column;
    }

    .cards-row {
        flex-direction: column;
    }

    .dimensions-row {
        flex-direction: column;
    }

    .btn-find {
        width: 100%;
    }
}
