@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.ms-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 700px;
    margin: 60px auto;
    background: #ffffff;
    padding: 60px 50px;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.05);
    color: #1e293b;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
}

/* Header */
.ms-main-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.ms-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #334155;
}

/* Stepper */
/* Stepper */
.ms-stepper {
    display: flex;
    /* Use standard flex flow, not space-between */
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

/* Timeline Line */
.ms-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    /* Center of 40px circle */
    /* 
       With 3 items, each is 33.33% wide.
       Center of first item is 33.33% / 2 = 16.66%
    */
    left: 16.66%;
    right: 16.66%;
    height: 2px;
    background: #e2e8f0;
    z-index: -1;
}

.ms-step {
    flex: 1;
    /* Each step takes equal width */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: default;
    padding: 0 10px;
    /* Removed background: white to avoid clipping issues if not needed */
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #e2e8f0;
    transition: all 0.3s ease;
}

.ms-step label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.3s ease;
}

/* Active State */
.ms-step.active .step-circle {
    background: #3b82f6;
    color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.ms-step.active label {
    color: #0f172a;
    font-weight: 600;
}

/* Form Views */
.ms-view {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.ms-view.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Inputs */
.ms-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.ms-flex {
    display: flex;
    gap: 20px;
}

.ms-flex>* {
    flex: 1;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.input-wrapper label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
}

.input-wrapper input {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.2s;
    font-family: inherit;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-wrapper input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 1.2em;
    /* Prevent layout shift */
}

/* Buttons */
.ms-footer {
    margin-top: 40px;
}

.ms-footer.right-align {
    display: flex;
    justify-content: flex-end;
}

.ms-footer.flex-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.ms-btn {
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    /* Make buttons equal width in flex container */
    max-width: 200px;
    /* But not too wide */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
}

.ms-footer.right-align .ms-btn {
    flex: 0 1 auto;
    /* Don't stretch single next button too much */
    min-width: 140px;
}

.ms-next,
.ms-submit {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ms-next:hover,
.ms-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.ms-next:active,
.ms-submit:active:not(:disabled) {
    transform: translateY(0);
}

.ms-prev {
    background: #f1f5f9;
    color: #475569;
}

.ms-prev:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ms-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Summary Box */
.ms-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    color: #64748b;
    font-size: 0.9rem;
}

.summary-item .value {
    font-weight: 600;
    color: #1e293b;
}

.value.badge {
    background: #fff7ed;
    color: #c2410c;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid #ffedd5;
}

/* Turnstile */
.ms-security {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}