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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background-color: #ffffff;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: #f3f4f6;
}

.back-button svg {
    display: block;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* Progress Steps */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 100px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background-color: #d97706;
    color: white;
}

.progress-step:not(.active) .step-number {
    background-color: #9ca3af;
    color: white;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: #1f2937;
}

.progress-step:not(.active) .step-label {
    color: #9ca3af;
}

.progress-line {
    height: 2px;
    background-color: #e5e7eb;
    flex: 1;
    margin: 0 16px;
    margin-bottom: 28px;
}

/* Form */
.address-form {
    padding: 24px 20px 100px;
    background-color: #f9fafb;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group.half {
    flex: 1;
    margin-bottom: 0;
}

.form-input {
    width: 100%;
    padding: 16px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background-color: white;
    transition: all 0.2s ease;
    color: #374151;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-input:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.form-input:invalid {
    border-color: #ef4444;
}

.state-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-select {
    width: 100%;
    padding: 16px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.save-button {
    width: 100%;
    padding: 16px;
    background-color: #d97706;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
}

.save-button:hover {
    background-color: #b45309;
    transform: translateY(-1px);
}

.save-button:active {
    transform: translateY(0);
}

.save-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .progress-container {
        padding: 24px 16px;
    }
    
    .address-form {
        padding: 20px 16px 80px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-group.half {
        width: 100%;
    }
}

/* Form validation styles */
.form-input:valid {
    border-color: #10b981;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.form-group.error .form-input {
    border-color: #ef4444;
}

/* Loading state */
.save-button.loading {
    position: relative;
    color: transparent;
}

.save-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success message */
.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}