/* All selectors scoped under #fmm-refill-form-wrap with !important on layout-critical props */

#fmm-refill-form-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
    line-height: 1.5;
}

#fmm-refill-form-wrap * {
    box-sizing: border-box;
}

#fmm-refill-form-wrap .fmm-form-header {
    text-align: center;
    margin-bottom: 24px;
}

#fmm-refill-form-wrap .fmm-form-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #111827;
}

#fmm-refill-form-wrap .fmm-form-header p {
    margin: 0;
    color: #6b7280;
}

/* Step indicators */
#fmm-refill-form-wrap .fmm-steps {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 4px;
    margin-bottom: 32px;
}

#fmm-refill-form-wrap .fmm-step {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 13px;
    color: #9ca3af;
    transition: all 0.2s;
    white-space: nowrap;
}

#fmm-refill-form-wrap .fmm-step.active {
    background: #2563eb;
    color: #fff;
}

#fmm-refill-form-wrap .fmm-step.completed {
    background: #d1fae5;
    color: #065f46;
}

#fmm-refill-form-wrap .fmm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 12px;
}

#fmm-refill-form-wrap .fmm-step.active .fmm-step-num {
    background: rgba(255,255,255,0.2);
}

#fmm-refill-form-wrap .fmm-step.completed .fmm-step-num {
    background: #10b981;
    color: #fff;
}

@media (max-width: 600px) {
    #fmm-refill-form-wrap .fmm-step-label {
        display: none;
    }
    #fmm-refill-form-wrap .fmm-step {
        padding: 8px;
    }
}

/* Step content */
#fmm-refill-form-wrap .fmm-step-content {
    display: none;
}

#fmm-refill-form-wrap .fmm-step-content.active {
    display: block;
}

#fmm-refill-form-wrap .fmm-step-content h3 {
    font-size: 18px;
    margin: 0 0 16px;
    color: #111827;
}

/* Form fields */
#fmm-refill-form-wrap label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
}

#fmm-refill-form-wrap .required {
    color: #ef4444;
}

#fmm-refill-form-wrap input[type="text"],
#fmm-refill-form-wrap input[type="tel"],
#fmm-refill-form-wrap input[type="number"],
#fmm-refill-form-wrap input[type="email"],
#fmm-refill-form-wrap textarea,
#fmm-refill-form-wrap select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s;
}

#fmm-refill-form-wrap input:focus,
#fmm-refill-form-wrap textarea:focus,
#fmm-refill-form-wrap select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Phone row */
#fmm-refill-form-wrap .fmm-phone-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
}

#fmm-refill-form-wrap .fmm-dial-code {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    white-space: nowrap;
    color: #374151;
}

#fmm-refill-form-wrap .fmm-phone-row .fmm-field {
    flex: 1;
}

/* OTP */
#fmm-refill-form-wrap .fmm-otp-section {
    margin-top: 16px;
}

#fmm-refill-form-wrap .fmm-otp-inputs {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    margin: 12px 0;
}

#fmm-refill-form-wrap .fmm-otp-digit {
    width: 48px !important;
    height: 48px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    padding: 0 !important;
    border: 2px solid #d1d5db;
    border-radius: 8px;
}

#fmm-refill-form-wrap .fmm-otp-digit:focus {
    border-color: #2563eb;
}

#fmm-refill-form-wrap .fmm-verified-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

#fmm-refill-form-wrap .fmm-help {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 8px;
}

/* Field groups (2-column grid) */
#fmm-refill-form-wrap .fmm-field-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    #fmm-refill-form-wrap .fmm-field-group {
        grid-template-columns: 1fr !important;
    }
}

/* Patient / item entries */
#fmm-refill-form-wrap .fmm-patient-entry,
#fmm-refill-form-wrap .fmm-item-entry {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

#fmm-refill-form-wrap .fmm-remove-entry {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

#fmm-refill-form-wrap .fmm-remove-entry:hover {
    background: #fef2f2;
    border-radius: 4px;
}

/* Location / prescription */
#fmm-refill-form-wrap .fmm-location-field {
    margin-bottom: 20px;
}

#fmm-refill-form-wrap .fmm-prescription-field {
    margin-bottom: 16px;
}

#fmm-refill-form-wrap input[type="file"] {
    font-size: 14px;
}

#fmm-refill-form-wrap #fmm-file-preview {
    margin-top: 8px;
}

#fmm-refill-form-wrap #fmm-file-preview img {
    max-width: 200px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Buttons */
#fmm-refill-form-wrap .fmm-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

#fmm-refill-form-wrap .fmm-btn-primary {
    background: #2563eb;
    color: #fff;
}

#fmm-refill-form-wrap .fmm-btn-primary:hover {
    background: #1d4ed8;
}

#fmm-refill-form-wrap .fmm-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

#fmm-refill-form-wrap .fmm-btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

#fmm-refill-form-wrap .fmm-btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Step navigation */
#fmm-refill-form-wrap .fmm-step-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Messages */
#fmm-refill-form-wrap .fmm-message {
    margin-top: 12px;
    font-size: 14px;
}

#fmm-refill-form-wrap .fmm-message.error {
    color: #ef4444;
}

#fmm-refill-form-wrap .fmm-message.success {
    color: #10b981;
}

/* Review summary */
#fmm-refill-form-wrap #fmm-review-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

#fmm-refill-form-wrap .fmm-review-section {
    margin-bottom: 16px;
}

#fmm-refill-form-wrap .fmm-review-section:last-child {
    margin-bottom: 0;
}

#fmm-refill-form-wrap .fmm-review-section h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#fmm-refill-form-wrap .fmm-review-section p,
#fmm-refill-form-wrap .fmm-review-section li {
    margin: 4px 0;
    font-size: 15px;
}

#fmm-refill-form-wrap .fmm-review-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Success screen */
#fmm-refill-form-wrap .fmm-success-content {
    text-align: center;
    padding: 40px 20px;
}

#fmm-refill-form-wrap .fmm-success-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

#fmm-refill-form-wrap .fmm-success-content h2 {
    font-size: 24px;
    margin: 0 0 12px;
    color: #065f46;
}

#fmm-refill-form-wrap .fmm-success-content p {
    font-size: 16px;
    color: #374151;
    margin: 8px 0;
}
