/* Modern, Mobile-First Tenant Signup Wizard */

/* Global Font Settings - Matches Application Header (Bootstrap) */
body,
.msform,
fieldset {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Fieldset Styles */
fieldset {
    display: none;
    background: white;
    border: 0 none;
    border-radius: 12px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 25px 20px;
    position: relative;
    min-height: 300px;
    box-shadow: 0 2px 12px rgba(0, 91, 189, 0.08);
}

fieldset.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fieldset headings */
.fs-title {
    font-size: 22px;
    color: #005BBD;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: left;
}

/* Progress Bar - Mobile Responsive */
#progressbar {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    margin-bottom: 25px;
    overflow: hidden;
    color: #999;
    padding: 0;
    counter-reset: step;
}

#progressbar .active {
    color: #005BBD;
}

#progressbar li {
    list-style-type: none;
    text-align: center;
    font-size: 13px;
    width: 20%;
    float: left;
    position: relative;
    font-weight: 500;
}

/* Progress bar icons */
#progressbar #step1:before {
    font-family: FontAwesome;
    content: "\f1ad"; /* Building icon */
}

#progressbar #step2:before {
    font-family: FontAwesome;
    content: "\f007"; /* User icon */
}

#progressbar #step3:before {
    font-family: FontAwesome;
    content: "\f09c"; /* Mobile icon for OTP */
}

#progressbar #step4:before {
    font-family: FontAwesome;
    content: "\f095"; /* Phone icon */
}

#progressbar #confirm:before {
    font-family: FontAwesome;
    content: "\f00c"; /* Check icon */
}

#progressbar li:before {
    width: 45px;
    height: 45px;
    line-height: 45px;
    display: block;
    font-size: 16px;
    color: #ffffff;
    background: #ccc;
    border-radius: 50%;
    margin: 0 auto 8px auto;
    transition: all 0.3s ease;
}

/* Progress bar connectors */
#progressbar li:after {
    content: '';
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    position: absolute;
    left: 0;
    top: 22px;
    z-index: -1;
    transition: all 0.3s ease;
}

#progressbar li.active:before,
#progressbar li.active:after {
    background: #005BBD;
}

#progressbar li.active:before {
    box-shadow: 0 2px 8px rgba(0, 91, 189, 0.3);
}

/* Form Elements - Modern Design */
.form-control {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 16px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 54px;
    box-sizing: border-box;
}

/* Placeholder Styling - Light and Subtle */
.form-control::placeholder {
    color: #999;
    font-weight: 400;
    opacity: 0.7;
}

.form-control::-webkit-input-placeholder {
    color: #999;
    font-weight: 400;
    opacity: 0.7;
}

.form-control::-moz-placeholder {
    color: #999;
    font-weight: 400;
    opacity: 0.7;
}

.form-control:-ms-input-placeholder {
    color: #999;
    font-weight: 400;
    opacity: 0.7;
}

.form-control:hover {
    border-color: #c0c0c0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.form-control:focus {
    border-color: #005BBD;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    outline: none;
    background: #fafbfc;
}

/* Modern Select/Dropdown Styling - Enhanced */
select.form-control,
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: white !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23005BBD' fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 45px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #333 !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px !important;
    padding: 18px 45px 18px 16px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    height: auto !important;
    min-height: 54px !important;
}

select.form-control:hover,
select:hover {
    border-color: #c0c0c0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23003d82' fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E") !important;
}

select.form-control:focus,
select:focus {
    border-color: #005BBD !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    background-color: #fafbfc !important;
}

select.form-control option,
select option {
    padding: 12px;
    font-size: 15px;
    color: #333;
    background: white;
}

/* Style placeholder-like first option */
select.form-control option:first-child,
select option:first-child {
    color: #999;
    font-weight: 400;
}

/* Disabled state */
.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

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

.form-group label {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px !important;
    display: block;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* Input groups and spacing */
.form-row .form-group {
    margin-bottom: 18px;
}

/* Buttons - Modern Style */
.btn {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #005BBD;
    color: white;
}

.btn-primary:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 91, 189, 0.3);
}

.previous {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.previous:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Radio Buttons - Modern Style */
.form-check {
    padding-left: 0;
    margin-bottom: 8px;
}

.form-check-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 25px;
    margin-bottom: 4px;
    margin-left: 15px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.form-check-inline:hover {
    background: #f8f9fa;
}

.form-check-inline input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    outline: none;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.form-check-inline input[type="radio"]:hover {
    border-color: #005BBD;
    box-shadow: 0 0 0 3px rgba(0, 91, 189, 0.1);
}

.form-check-inline input[type="radio"]:checked {
    border-color: #005BBD;
    border-width: 2px;
    background: white;
}

.form-check-inline input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #005BBD;
}

.form-check-inline label {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 0;
    line-height: 1.4;
    user-select: none;
}

/* Mobile Optimizations */
@media screen and (max-width: 768px) {
    fieldset {
        padding: 20px 15px;
        min-height: 250px;
    }

    .fs-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    #progressbar li {
        font-size: 11px;
        width: 20%;
    }

    #progressbar li:before {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 14px;
        margin-bottom: 5px;
    }

    #progressbar li:after {
        top: 19px;
        height: 2px;
    }

    /* Hide progress bar text on very small screens */
    #progressbar li strong {
        display: none;
    }

    .form-control {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 50px;
    }

    select.form-control,
    select {
        padding: 14px 45px 14px 14px !important;
        min-height: 50px !important;
        font-size: 15px !important;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
        margin-bottom: 10px;
    }

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

    .form-group label {
        font-size: 14px;
        margin-bottom: 7px;
    }

    .form-row {
        margin-left: 0;
        margin-right: 0;
    }

    .form-row > [class*='col-'] {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 16px;
    }

    .form-check-inline {
        margin-right: 15px;
        margin-left: 10px;
        padding: 6px 10px;
    }

    .form-check-inline label {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    #progressbar li {
        font-size: 0; /* Hide text completely */
    }

    #progressbar li:before {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 12px;
    }

    #progressbar li:after {
        top: 16px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .text-center p {
        font-size: 14px;
    }

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 48px;
        padding: 12px;
    }

    select.form-control,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 48px !important;
        padding: 12px 40px 12px 12px !important;
    }

    .form-check-inline {
        margin-right: 10px;
        margin-left: 5px;
        padding: 5px 8px;
    }

    .form-check-inline input[type="radio"] {
        width: 18px;
        height: 18px;
    }

    .form-check-inline input[type="radio"]:checked::before {
        width: 8px;
        height: 8px;
    }

    .form-check-inline label {
        font-size: 14px;
    }
}

/* Container Improvements */
#grad1 {
    background: linear-gradient(135deg, #005BBD 0%, #003d82 100%);
    min-height: 100vh;
    padding: 30px 0;
}

.msform {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

/* Form Card Inner Styling */
.form-card {
    padding: 10px 0;
}

@media screen and (max-width: 768px) {
    #grad1 {
        padding: 20px 10px;
        min-height: 100vh;
    }

    .msform {
        padding: 25px 20px;
        border-radius: 15px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
}

@media screen and (max-width: 480px) {
    #grad1 {
        padding: 15px 8px;
    }

    .msform {
        padding: 20px 15px;
        border-radius: 12px;
    }
}

/* Heading Styles - Modern Typography */
h2 {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 32px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-center p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Page title container */
.row.text-center {
    margin-bottom: 30px;
}

/* Error Messages */
div.text-danger {
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Required field asterisk - keep inline */
span.text-danger {
    display: inline;
    margin-left: 2px;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Verification Success Message */
#animationContainer {
    padding: 18px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
    border: 2px solid #86efac;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

#animation {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.confirmation-animation {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #16a34a;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.5;
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

input,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Accessibility Improvements */
.form-control:focus,
.btn:focus {
    outline: none;
}

/* Animation Container Parent - Vertical Centering */
.container.d-flex:has(#animationContainer) {
    min-height: 200px;
}

/* Alternative selector for browsers that don't support :has() */
#animationContainer {
    margin-top: auto;
    margin-bottom: auto;
}

/* Print Styles */
@media print {
    #grad1 {
        background: white;
    }

    .msform {
        box-shadow: none;
    }
}
