/* ==========================================================================
   INAIVOM - Forms
   File: app/static/css/forms.css
   Premium Matrimony Platform
   Theme: Maroon #800020 | Gold #D4AF37 | White
   ========================================================================== */


/* ==========================================================================
   1. FORM VARIABLES
   ========================================================================== */

:root {
    --form-maroon: #800020;
    --form-maroon-dark: #650019;
    --form-maroon-light: #9b1738;

    --form-gold: #d4af37;
    --form-gold-dark: #a9861d;
    --form-gold-light: #ead77f;

    --form-white: #ffffff;
    --form-bg: #ffffff;
    --form-bg-soft: #fdfafb;
    --form-bg-disabled: #f3f0f2;

    --form-text: #2d282b;
    --form-muted: #766e73;
    --form-placeholder: #aaa2a7;

    --form-border: #ddd6da;
    --form-border-hover: #c7bcc1;

    --form-success: #198754;
    --form-danger: #dc3545;
    --form-warning: #d39e00;
    --form-info: #0d6efd;

    --form-radius-sm: 8px;
    --form-radius: 10px;
    --form-radius-lg: 14px;

    --form-shadow:
        0 3px 10px rgba(38, 22, 29, 0.04);

    --form-focus-shadow:
        0 0 0 3px rgba(128, 0, 32, 0.09);

    --form-gold-focus-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.14);

    --form-transition:
        180ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ==========================================================================
   2. FORM BASE
   ========================================================================== */

form {
    width: 100%;
}

.form-group {
    position: relative;

    margin-bottom: 1.15rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;

    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.form-row > * {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 1rem 1.25rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 1rem 1.25rem;
}

.form-grid-1 {
    display: grid;
    grid-template-columns: 1fr;

    gap: 1rem;
}


/* ==========================================================================
   3. LABEL
   ========================================================================== */

.form-label,
label.form-label {
    display: inline-block;

    margin-bottom: 0.45rem;

    color: var(--form-text);

    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
}

.form-label.required::after,
.required-label::after {
    content: " *";

    color: var(--form-danger);

    font-weight: 700;
}

.form-label-optional {
    margin-left: 0.3rem;

    color: var(--form-muted);

    font-size: 0.7rem;
    font-weight: 400;
}


/* ==========================================================================
   4. STANDARD INPUTS
   ========================================================================== */

.form-control,
.form-select,
input.form-control,
textarea.form-control,
select.form-control {
    display: block;

    width: 100%;
    min-height: 44px;

    padding: 0.65rem 0.8rem;

    border: 1px solid var(--form-border);
    border-radius: var(--form-radius);

    background-color: var(--form-bg);
    color: var(--form-text);

    box-shadow: var(--form-shadow);

    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.45;

    appearance: none;
    -webkit-appearance: none;

    transition:
        border-color var(--form-transition),
        box-shadow var(--form-transition),
        background-color var(--form-transition);
}


/* ==========================================================================
   5. INPUT HOVER
   ========================================================================== */

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled),
input.form-control:hover:not(:disabled):not([readonly]),
textarea.form-control:hover:not(:disabled):not([readonly]) {
    border-color: var(--form-border-hover);
}


/* ==========================================================================
   6. INPUT FOCUS
   ========================================================================== */

.form-control:focus,
.form-select:focus,
input.form-control:focus,
textarea.form-control:focus,
select.form-control:focus {
    border-color: var(--form-maroon);

    background-color: var(--form-white);

    outline: 0;

    box-shadow: var(--form-focus-shadow);
}


/* ==========================================================================
   7. PLACEHOLDER
   ========================================================================== */

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--form-placeholder);

    opacity: 1;
}


/* ==========================================================================
   8. DISABLED / READONLY
   ========================================================================== */

.form-control:disabled,
.form-select:disabled,
.form-control[readonly],
input:disabled,
textarea:disabled,
select:disabled {
    border-color: #e2dde0;

    background-color: var(--form-bg-disabled);

    color: #938b90;

    box-shadow: none;

    cursor: not-allowed;

    opacity: 1;
}

.form-control[readonly] {
    cursor: default;
}


/* ==========================================================================
   9. TEXTAREA
   ========================================================================== */

textarea.form-control {
    min-height: 110px;

    resize: vertical;

    line-height: 1.6;
}

textarea.form-control-sm {
    min-height: 80px;
}

textarea.form-control-lg {
    min-height: 150px;
}


/* ==========================================================================
   10. SELECT
   ========================================================================== */

.form-select,
select.form-control {
    padding-right: 2.5rem;

    background-image:
        linear-gradient(45deg, transparent 50%, #766e73 50%),
        linear-gradient(135deg, #766e73 50%, transparent 50%);

    background-position:
        calc(100% - 17px) 50%,
        calc(100% - 12px) 50%;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;

    cursor: pointer;
}

.form-select:focus,
select.form-control:focus {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--form-maroon) 50%),
        linear-gradient(135deg, var(--form-maroon) 50%, transparent 50%);
}

.form-select[multiple],
select.form-control[multiple] {
    min-height: 130px;

    padding-right: 0.8rem;

    background-image: none;
}


/* ==========================================================================
   11. INPUT SIZES
   ========================================================================== */

.form-control-sm,
.form-select-sm {
    min-height: 36px;

    padding: 0.45rem 0.7rem;

    border-radius: var(--form-radius-sm);

    font-size: 0.78rem;
}

.form-control-lg,
.form-select-lg {
    min-height: 50px;

    padding: 0.75rem 0.95rem;

    border-radius: var(--form-radius-lg);

    font-size: 0.94rem;
}


/* ==========================================================================
   12. FORM TEXT / HELP TEXT
   ========================================================================== */

.form-text,
.form-help,
.help-text {
    display: block;

    margin-top: 0.35rem;

    color: var(--form-muted);

    font-size: 0.7rem;
    line-height: 1.5;
}


/* ==========================================================================
   13. VALIDATION - INVALID
   ========================================================================== */

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--form-danger);

    background-color: #fffafb;

    box-shadow:
        0 0 0 3px rgba(220, 53, 69, 0.07);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
    border-color: var(--form-danger);

    box-shadow:
        0 0 0 3px rgba(220, 53, 69, 0.12);
}

.invalid-feedback,
.form-error {
    display: none;

    width: 100%;

    margin-top: 0.35rem;

    color: var(--form-danger);

    font-size: 0.7rem;
    line-height: 1.45;
}

.is-invalid ~ .invalid-feedback,
.is-invalid ~ .form-error,
.was-validated :invalid ~ .invalid-feedback {
    display: block;
}


/* ==========================================================================
   14. VALIDATION - VALID
   ========================================================================== */

.form-control.is-valid,
.form-select.is-valid,
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--form-success);

    box-shadow:
        0 0 0 3px rgba(25, 135, 84, 0.06);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--form-success);

    box-shadow:
        0 0 0 3px rgba(25, 135, 84, 0.1);
}

.valid-feedback,
.form-success {
    display: none;

    width: 100%;

    margin-top: 0.35rem;

    color: var(--form-success);

    font-size: 0.7rem;
    line-height: 1.45;
}

.is-valid ~ .valid-feedback,
.is-valid ~ .form-success,
.was-validated :valid ~ .valid-feedback {
    display: block;
}


/* ==========================================================================
   15. CHECKBOX / RADIO BASE
   ========================================================================== */

.form-check {
    position: relative;

    display: flex;
    align-items: flex-start;

    min-height: 1.4rem;

    gap: 0.55rem;
}

.form-check + .form-check {
    margin-top: 0.55rem;
}

.form-check-input {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    margin: 0.1rem 0 0;

    border: 1.5px solid #bdb4b9;

    background-color: #ffffff;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background-color var(--form-transition),
        border-color var(--form-transition),
        box-shadow var(--form-transition);
}

.form-check-input[type="checkbox"] {
    border-radius: 5px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}


/* ==========================================================================
   16. CHECKBOX CHECKED
   ========================================================================== */

.form-check-input[type="checkbox"]:checked {
    border-color: var(--form-maroon);

    background-color: var(--form-maroon);

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 8l3 3 7-7'/%3E%3C/svg%3E");

    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
}


/* ==========================================================================
   17. RADIO CHECKED
   ========================================================================== */

.form-check-input[type="radio"]:checked {
    border-color: var(--form-maroon);

    background-color: var(--form-maroon);

    box-shadow:
        inset 0 0 0 4px #ffffff;
}


/* ==========================================================================
   18. CHECK / RADIO FOCUS
   ========================================================================== */

.form-check-input:focus-visible {
    outline: 0;

    border-color: var(--form-maroon);

    box-shadow: var(--form-focus-shadow);
}

.form-check-input:disabled {
    border-color: #d7d1d4;

    background-color: #ece9ea;

    cursor: not-allowed;

    opacity: 0.7;
}

.form-check-label {
    color: var(--form-text);

    font-size: 0.8rem;
    line-height: 1.5;

    cursor: pointer;
}


/* ==========================================================================
   19. SWITCH
   ========================================================================== */

.form-switch {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-switch .form-check-input {
    position: relative;

    width: 42px;
    height: 23px;

    flex: 0 0 42px;

    margin: 0;

    border: 1px solid #c8c0c4;
    border-radius: 999px;

    background-color: #dcd7d9;
    background-image: none;

    cursor: pointer;
}

.form-switch .form-check-input::before {
    content: "";

    position: absolute;
    top: 2px;
    left: 2px;

    width: 17px;
    height: 17px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.16);

    transition:
        transform var(--form-transition);
}

.form-switch .form-check-input:checked {
    border-color: var(--form-maroon);

    background-color: var(--form-maroon);

    background-image: none;

    box-shadow: none;
}

.form-switch .form-check-input:checked::before {
    transform: translateX(19px);
}


/* ==========================================================================
   20. INPUT GROUP
   ========================================================================== */

.input-group {
    position: relative;

    display: flex;
    align-items: stretch;

    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;

    flex: 1 1 auto;

    width: 1%;
    min-width: 0;

    border-radius: 0;
}

.input-group > .form-control:first-child,
.input-group > .form-select:first-child,
.input-group > .input-group-text:first-child {
    border-top-left-radius: var(--form-radius);
    border-bottom-left-radius: var(--form-radius);
}

.input-group > .form-control:last-child,
.input-group > .form-select:last-child,
.input-group > .input-group-text:last-child,
.input-group > .btn:last-child {
    border-top-right-radius: var(--form-radius);
    border-bottom-right-radius: var(--form-radius);
}

.input-group > * + * {
    margin-left: -1px;
}


/* ==========================================================================
   21. INPUT GROUP TEXT
   ========================================================================== */

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 44px;

    padding: 0.65rem 0.75rem;

    border: 1px solid var(--form-border);

    background: #f7f4f5;
    color: var(--form-muted);

    font-size: 0.8rem;
    font-weight: 500;

    white-space: nowrap;
}


/* ==========================================================================
   22. INPUT WITH ICON
   ========================================================================== */

.form-icon-group {
    position: relative;
}

.form-icon-group .form-control {
    padding-left: 2.6rem;
}

.form-icon {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    color: #958b90;

    pointer-events: none;

    transition:
        color var(--form-transition);
}

.form-icon-group:focus-within .form-icon {
    color: var(--form-maroon);
}

.form-icon-right .form-control {
    padding-right: 2.6rem;
    padding-left: 0.8rem;
}

.form-icon-right .form-icon {
    right: 0.85rem;
    left: auto;
}


/* ==========================================================================
   23. PASSWORD FIELD
   ========================================================================== */

.password-field,
.password-wrapper {
    position: relative;
}

.password-field .form-control,
.password-wrapper .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    transform: translateY(-50%);

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: #847a80;

    cursor: pointer;

    transition:
        background var(--form-transition),
        color var(--form-transition);
}

.password-toggle:hover {
    background: rgba(128, 0, 32, 0.06);

    color: var(--form-maroon);
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.5);
    outline-offset: 1px;
}


/* ==========================================================================
   24. PASSWORD STRENGTH
   ========================================================================== */

.password-strength {
    margin-top: 0.55rem;
}

.password-strength-bar {
    display: flex;

    gap: 0.25rem;

    width: 100%;
}

.password-strength-segment {
    flex: 1;

    height: 4px;

    border-radius: 999px;

    background: #e9e4e6;
}

.password-strength.weak .password-strength-segment:nth-child(1) {
    background: var(--form-danger);
}

.password-strength.medium .password-strength-segment:nth-child(-n + 2) {
    background: var(--form-warning);
}

.password-strength.strong .password-strength-segment:nth-child(-n + 3) {
    background: var(--form-success);
}

.password-strength.very-strong .password-strength-segment {
    background: var(--form-success);
}

.password-strength-text {
    margin-top: 0.3rem;

    color: var(--form-muted);

    font-size: 0.68rem;
}


/* ==========================================================================
   25. FLOATING LABEL
   ========================================================================== */

.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select {
    min-height: 56px;

    padding: 1.35rem 0.8rem 0.4rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;

    padding: 1rem 0.8rem;

    color: var(--form-muted);

    font-size: 0.82rem;

    pointer-events: none;

    transform-origin: 0 0;

    transition:
        opacity var(--form-transition),
        transform var(--form-transition),
        color var(--form-transition);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--form-maroon);

    transform:
        scale(0.82)
        translateY(-0.3rem)
        translateX(0.15rem);
}


/* ==========================================================================
   26. SEARCH FIELD
   ========================================================================== */

.search-input-wrapper,
.search-field {
    position: relative;
}

.search-input-wrapper .form-control,
.search-field .form-control {
    padding-right: 2.8rem;
    padding-left: 2.65rem;

    border-radius: 999px;

    background: #ffffff;
}

.search-input-icon,
.search-field-icon {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    z-index: 2;

    transform: translateY(-50%);

    color: #8f858a;

    pointer-events: none;
}

.search-input-clear,
.search-field-clear {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #8f858a;

    cursor: pointer;
}

.search-input-clear:hover,
.search-field-clear:hover {
    background: rgba(128, 0, 32, 0.06);

    color: var(--form-maroon);
}


/* ==========================================================================
   27. FILE INPUT
   ========================================================================== */

.form-control[type="file"] {
    padding: 0.42rem;

    cursor: pointer;
}

.form-control[type="file"]::file-selector-button {
    min-height: 32px;

    margin: -0.15rem 0.75rem -0.15rem -0.15rem;
    padding: 0.45rem 0.8rem;

    border: 0;
    border-radius: 7px;

    background: rgba(128, 0, 32, 0.08);
    color: var(--form-maroon);

    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background var(--form-transition),
        color var(--form-transition);
}

.form-control[type="file"]::file-selector-button:hover {
    background: var(--form-maroon);

    color: #ffffff;
}


/* ==========================================================================
   28. UPLOAD AREA
   ========================================================================== */

.file-upload,
.upload-area,
.dropzone {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    min-height: 160px;

    padding: 1.5rem;

    border: 1.5px dashed #cfc5ca;
    border-radius: var(--form-radius-lg);

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fdfafb
        );

    color: var(--form-muted);

    text-align: center;

    cursor: pointer;

    transition:
        border-color var(--form-transition),
        background var(--form-transition),
        box-shadow var(--form-transition);
}

.file-upload:hover,
.upload-area:hover,
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--form-maroon);

    background: #fff9fb;

    box-shadow: var(--form-focus-shadow);
}

.file-upload-icon,
.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin-bottom: 0.75rem;

    border-radius: 50%;

    background: rgba(128, 0, 32, 0.07);
    color: var(--form-maroon);

    font-size: 1.25rem;
}

.file-upload-title,
.upload-title {
    margin: 0;

    color: var(--form-text);

    font-size: 0.86rem;
    font-weight: 600;
}

.file-upload-text,
.upload-text {
    margin: 0.35rem 0 0;

    color: var(--form-muted);

    font-size: 0.72rem;
}


/* ==========================================================================
   29. UPLOADED FILE ITEM
   ========================================================================== */

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.7rem 0.8rem;

    border: 1px solid var(--form-border);
    border-radius: var(--form-radius);

    background: #ffffff;
}

.uploaded-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    border-radius: 9px;

    background: rgba(128, 0, 32, 0.07);
    color: var(--form-maroon);
}

.uploaded-file-info {
    flex: 1;
    min-width: 0;
}

.uploaded-file-name {
    overflow: hidden;

    color: var(--form-text);

    font-size: 0.78rem;
    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.uploaded-file-meta {
    margin-top: 0.15rem;

    color: var(--form-muted);

    font-size: 0.66rem;
}


/* ==========================================================================
   30. RANGE INPUT
   ========================================================================== */

.form-range {
    width: 100%;
    height: 6px;

    border-radius: 999px;

    background: #e5dfe2;

    outline: 0;

    appearance: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    width: 18px;
    height: 18px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: var(--form-maroon);

    box-shadow:
        0 2px 7px rgba(128, 0, 32, 0.25);

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.form-range::-moz-range-thumb {
    width: 14px;
    height: 14px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: var(--form-maroon);

    box-shadow:
        0 2px 7px rgba(128, 0, 32, 0.25);

    cursor: pointer;
}


/* ==========================================================================
   31. DATE / TIME INPUTS
   ========================================================================== */

input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
    color-scheme: light;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;

    opacity: 0.65;
}


/* ==========================================================================
   32. NUMBER INPUT
   ========================================================================== */

input[type="number"].form-control {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"].form-control::-webkit-inner-spin-button,
input[type="number"].form-control::-webkit-outer-spin-button {
    margin: 0;

    appearance: none;
    -webkit-appearance: none;
}


/* ==========================================================================
   33. FORM SECTION
   ========================================================================== */

.form-section {
    padding: 1.4rem;

    border: 1px solid #ebe5e8;
    border-radius: var(--form-radius-lg);

    background: #ffffff;
}

.form-section + .form-section {
    margin-top: 1.25rem;
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;

    border-bottom: 1px solid #eee9eb;
}

.form-section-title {
    margin: 0;

    color: var(--form-maroon);

    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.form-section-description {
    margin: 0.25rem 0 0;

    color: var(--form-muted);

    font-size: 0.72rem;
    line-height: 1.5;
}


/* ==========================================================================
   34. FORM CARD
   ========================================================================== */

.form-card {
    padding: 1.5rem;

    border: 1px solid #e9e2e5;
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 8px 24px rgba(42, 25, 32, 0.06);
}


/* ==========================================================================
   35. AUTH FORM
   ========================================================================== */

.auth-form {
    width: 100%;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-control,
.auth-form .form-select {
    min-height: 48px;
}

.auth-form .btn[type="submit"],
.auth-form button[type="submit"] {
    min-height: 48px;
}


/* ==========================================================================
   36. LOGIN / REGISTER DIVIDER
   ========================================================================== */

.form-divider,
.auth-divider {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 1.35rem 0;

    color: var(--form-muted);

    font-size: 0.7rem;
}

.form-divider::before,
.form-divider::after,
.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #e7e1e4;
}

.form-divider span,
.auth-divider span {
    padding: 0 0.75rem;

    background: #ffffff;
}


/* ==========================================================================
   37. MATRIMONY PROFILE FORM
   ========================================================================== */

.profile-form {
    width: 100%;
}

.profile-form-section {
    margin-bottom: 1.5rem;
}

.profile-form-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    margin-bottom: 1rem;

    color: var(--form-maroon);

    font-size: 0.95rem;
    font-weight: 700;
}

.profile-form-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border-radius: 9px;

    background: rgba(128, 0, 32, 0.07);
    color: var(--form-maroon);
}


/* ==========================================================================
   38. PROFILE COMPLETION INDICATOR
   ========================================================================== */

.form-completion {
    margin-bottom: 1.4rem;
}

.form-completion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 0.45rem;
}

.form-completion-label {
    color: var(--form-text);

    font-size: 0.76rem;
    font-weight: 600;
}

.form-completion-value {
    color: var(--form-maroon);

    font-size: 0.76rem;
    font-weight: 700;
}

.form-completion-track {
    width: 100%;
    height: 6px;

    overflow: hidden;

    border-radius: 999px;

    background: #e9e4e6;
}

.form-completion-bar {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--form-maroon),
            var(--form-gold)
        );

    transition:
        width 300ms ease;
}


/* ==========================================================================
   39. INTEREST / TAG SELECTION
   ========================================================================== */

.tag-options,
.interest-options {
    display: flex;
    flex-wrap: wrap;

    gap: 0.55rem;
}

.tag-option,
.interest-option {
    position: relative;
}

.tag-option input,
.interest-option input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}

.tag-option label,
.interest-option label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 0.45rem 0.8rem;

    border: 1px solid var(--form-border);
    border-radius: 999px;

    background: #ffffff;
    color: #645c61;

    font-size: 0.74rem;
    font-weight: 500;

    cursor: pointer;

    transition:
        border-color var(--form-transition),
        background var(--form-transition),
        color var(--form-transition),
        box-shadow var(--form-transition);
}

.tag-option label:hover,
.interest-option label:hover {
    border-color: rgba(128, 0, 32, 0.4);

    color: var(--form-maroon);
}

.tag-option input:checked + label,
.interest-option input:checked + label {
    border-color: var(--form-maroon);

    background: rgba(128, 0, 32, 0.07);
    color: var(--form-maroon);

    box-shadow:
        0 0 0 2px rgba(128, 0, 32, 0.04);
}

.tag-option input:focus-visible + label,
.interest-option input:focus-visible + label {
    outline: 3px solid rgba(212, 175, 55, 0.3);
    outline-offset: 2px;
}


/* ==========================================================================
   40. GENDER / OPTION CARDS
   ========================================================================== */

.form-option-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 0.75rem;
}

.form-option-card {
    position: relative;
}

.form-option-card input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.form-option-card label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    min-height: 48px;

    padding: 0.65rem 0.8rem;

    border: 1px solid var(--form-border);
    border-radius: var(--form-radius);

    background: #ffffff;
    color: var(--form-text);

    font-size: 0.8rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        border-color var(--form-transition),
        background var(--form-transition),
        color var(--form-transition),
        box-shadow var(--form-transition);
}

.form-option-card label:hover {
    border-color: rgba(128, 0, 32, 0.35);
}

.form-option-card input:checked + label {
    border-color: var(--form-maroon);

    background:
        linear-gradient(
            145deg,
            #fff9fb,
            rgba(128, 0, 32, 0.05)
        );

    color: var(--form-maroon);

    box-shadow: var(--form-focus-shadow);
}


/* ==========================================================================
   41. SEARCH FILTER FORM
   ========================================================================== */

.filter-form {
    width: 100%;
}

.filter-form-section {
    padding: 1rem 0;

    border-bottom: 1px solid #eee9eb;
}

.filter-form-section:first-child {
    padding-top: 0;
}

.filter-form-section:last-child {
    padding-bottom: 0;

    border-bottom: 0;
}

.filter-form-title {
    margin: 0 0 0.75rem;

    color: var(--form-text);

    font-size: 0.82rem;
    font-weight: 700;
}


/* ==========================================================================
   42. RANGE PAIR
   ========================================================================== */

.range-fields,
.age-range,
.height-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);

    align-items: center;

    gap: 0.55rem;
}

.range-separator {
    color: var(--form-muted);

    font-size: 0.72rem;

    text-align: center;
}


/* ==========================================================================
   43. PHONE FIELD
   ========================================================================== */

.phone-field {
    display: flex;

    width: 100%;
}

.phone-country-code {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 70px;

    padding: 0.65rem 0.7rem;

    border: 1px solid var(--form-border);
    border-right: 0;
    border-radius:
        var(--form-radius)
        0
        0
        var(--form-radius);

    background: #f7f4f5;
    color: var(--form-text);

    font-size: 0.8rem;
    font-weight: 600;
}

.phone-field .form-control {
    border-radius:
        0
        var(--form-radius)
        var(--form-radius)
        0;
}


/* ==========================================================================
   44. OTP INPUT
   ========================================================================== */

.otp-inputs,
.otp-group {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 0.55rem;
}

.otp-input,
.otp-group .form-control {
    width: 48px;
    height: 52px;

    flex: 0 0 48px;

    padding: 0.5rem;

    border: 1px solid var(--form-border);
    border-radius: 10px;

    background: #ffffff;

    color: var(--form-maroon);

    font-size: 1.15rem;
    font-weight: 700;

    text-align: center;

    outline: none;

    transition:
        border-color var(--form-transition),
        box-shadow var(--form-transition);
}

.otp-input:focus,
.otp-group .form-control:focus {
    border-color: var(--form-maroon);

    box-shadow: var(--form-focus-shadow);
}


/* ==========================================================================
   45. AUTOCOMPLETE
   ========================================================================== */

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-menu,
.form-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    z-index: 1050;

    max-height: 260px;

    overflow-y: auto;

    padding: 0.35rem;

    border: 1px solid var(--form-border);
    border-radius: var(--form-radius);

    background: #ffffff;

    box-shadow:
        0 12px 30px rgba(35, 21, 27, 0.13);
}

.autocomplete-item,
.form-suggestion {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    width: 100%;

    padding: 0.6rem 0.7rem;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: var(--form-text);

    font-size: 0.78rem;

    text-align: left;

    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.active,
.form-suggestion:hover,
.form-suggestion.active {
    background: rgba(128, 0, 32, 0.06);

    color: var(--form-maroon);
}


/* ==========================================================================
   46. FORM ACTIONS
   ========================================================================== */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 0.65rem;

    margin-top: 1.5rem;
    padding-top: 1.1rem;

    border-top: 1px solid #eee8eb;
}

.form-actions-left {
    justify-content: flex-start;
}

.form-actions-center {
    justify-content: center;
}

.form-actions-between {
    justify-content: space-between;
}


/* ==========================================================================
   47. INLINE FORM
   ========================================================================== */

.form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 0.75rem;
}

.form-inline .form-group {
    margin-bottom: 0;
}


/* ==========================================================================
   48. FORM STATUS MESSAGE
   ========================================================================== */

.form-status {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;

    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;

    border: 1px solid transparent;
    border-radius: var(--form-radius);

    font-size: 0.75rem;
    line-height: 1.5;
}

.form-status-success {
    border-color: rgba(25, 135, 84, 0.2);

    background: rgba(25, 135, 84, 0.06);
    color: #146c43;
}

.form-status-danger,
.form-status-error {
    border-color: rgba(220, 53, 69, 0.2);

    background: rgba(220, 53, 69, 0.06);
    color: #b02a37;
}

.form-status-warning {
    border-color: rgba(212, 175, 55, 0.3);

    background: rgba(212, 175, 55, 0.09);
    color: #80620a;
}


/* ==========================================================================
   49. FORM LOADING
   ========================================================================== */

.form-loading {
    position: relative;

    pointer-events: none;
}

.form-loading::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 20;

    border-radius: inherit;

    background: rgba(255, 255, 255, 0.68);

    cursor: wait;
}


/* ==========================================================================
   50. CHARACTER COUNTER
   ========================================================================== */

.form-counter,
.character-counter {
    display: block;

    margin-top: 0.3rem;

    color: var(--form-muted);

    font-size: 0.66rem;

    text-align: right;
}

.form-counter.warning,
.character-counter.warning {
    color: var(--form-warning);
}

.form-counter.danger,
.character-counter.danger {
    color: var(--form-danger);
}


/* ==========================================================================
   51. PREMIUM / GOLD INPUT
   ========================================================================== */

.form-control-premium,
.form-select-premium {
    border-color: rgba(212, 175, 55, 0.5);

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fffdf7
        );
}

.form-control-premium:focus,
.form-select-premium:focus {
    border-color: var(--form-gold);

    box-shadow: var(--form-gold-focus-shadow);
}


/* ==========================================================================
   52. CONSENT BOX
   ========================================================================== */

.consent-box,
.terms-box {
    padding: 1rem;

    border: 1px solid #e6dfe2;
    border-radius: var(--form-radius);

    background: #fdfafb;
}

.consent-box .form-check-label,
.terms-box .form-check-label {
    color: #665d62;

    font-size: 0.74rem;
    line-height: 1.6;
}

.consent-box a,
.terms-box a {
    color: var(--form-maroon);

    font-weight: 600;
    text-decoration: none;
}

.consent-box a:hover,
.terms-box a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   53. CAPTCHA CONTAINER
   ========================================================================== */

.captcha-container {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 78px;

    padding: 0.75rem;

    border: 1px solid #e4dde0;
    border-radius: var(--form-radius);

    background: #faf8f9;
}


/* ==========================================================================
   54. PROFILE PHOTO UPLOAD
   ========================================================================== */

.profile-photo-upload {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-photo-preview {
    position: relative;

    width: 110px;
    height: 110px;

    flex: 0 0 110px;

    overflow: hidden;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #eee9eb;

    box-shadow:
        0 0 0 1px #ddd5d9,
        0 5px 16px rgba(37, 21, 28, 0.1);
}

.profile-photo-preview img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.profile-photo-actions {
    display: flex;
    align-items: flex-start;
    flex-direction: column;

    gap: 0.55rem;
}


/* ==========================================================================
   55. DOCUMENT UPLOAD
   ========================================================================== */

.document-upload-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );

    gap: 1rem;
}

.document-upload-card {
    position: relative;

    padding: 1rem;

    border: 1px solid var(--form-border);
    border-radius: var(--form-radius);

    background: #ffffff;

    transition:
        border-color var(--form-transition),
        box-shadow var(--form-transition);
}

.document-upload-card:hover {
    border-color: rgba(128, 0, 32, 0.25);

    box-shadow:
        0 5px 14px rgba(42, 24, 31, 0.06);
}


/* ==========================================================================
   56. FORM STEPS
   ========================================================================== */

.form-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 1.75rem;
}

.form-step {
    position: relative;

    flex: 1;

    text-align: center;
}

.form-step:not(:last-child)::after {
    content: "";

    position: absolute;
    top: 16px;
    left: 50%;

    width: 100%;
    height: 2px;

    background: #e7e1e4;
}

.form-step-number {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    margin: 0 auto;

    border: 2px solid #d7ced2;
    border-radius: 50%;

    background: #ffffff;
    color: #81777c;

    font-size: 0.75rem;
    font-weight: 700;
}

.form-step-label {
    display: block;

    margin-top: 0.45rem;

    color: var(--form-muted);

    font-size: 0.68rem;
    font-weight: 500;
}

.form-step.active .form-step-number {
    border-color: var(--form-maroon);

    background: var(--form-maroon);
    color: #ffffff;

    box-shadow:
        0 4px 12px rgba(128, 0, 32, 0.18);
}

.form-step.active .form-step-label {
    color: var(--form-maroon);

    font-weight: 700;
}

.form-step.completed .form-step-number {
    border-color: var(--form-gold);

    background: var(--form-gold);
    color: #3f2c00;
}

.form-step.completed:not(:last-child)::after {
    background:
        linear-gradient(
            90deg,
            var(--form-gold),
            #e7e1e4
        );
}


/* ==========================================================================
   57. FORM FIELDSET
   ========================================================================== */

.form-fieldset,
fieldset.form-fieldset {
    min-width: 0;

    margin: 0;
    padding: 1.25rem;

    border: 1px solid #e8e1e4;
    border-radius: var(--form-radius-lg);

    background: #ffffff;
}

.form-fieldset + .form-fieldset {
    margin-top: 1.25rem;
}

.form-legend,
.form-fieldset legend {
    width: auto;

    margin: 0;
    padding: 0 0.5rem;

    color: var(--form-maroon);

    font-size: 0.86rem;
    font-weight: 700;
}


/* ==========================================================================
   58. REQUIRED NOTE
   ========================================================================== */

.form-required-note {
    margin-bottom: 1rem;

    color: var(--form-muted);

    font-size: 0.68rem;
}

.form-required-note span {
    color: var(--form-danger);

    font-weight: 700;
}


/* ==========================================================================
   59. FORM LINKS
   ========================================================================== */

.form-link {
    color: var(--form-maroon);

    font-size: inherit;
    font-weight: 600;

    text-decoration: none;
}

.form-link:hover {
    color: var(--form-maroon-dark);

    text-decoration: underline;
}


/* ==========================================================================
   60. AUTOFILL
   ========================================================================== */

input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:hover,
input.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--form-text);

    -webkit-box-shadow:
        0 0 0 1000px #ffffff inset;

    transition:
        background-color 9999s ease-in-out 0s;
}


/* ==========================================================================
   61. FOCUS ACCESSIBILITY
   ========================================================================== */

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.form-check-input:focus-visible {
    outline: none;
}

.form-control:focus-visible,
.form-select:focus-visible {
    border-color: var(--form-maroon);

    box-shadow: var(--form-focus-shadow);
}


/* ==========================================================================
   62. RESPONSIVE - TABLET
   ========================================================================== */

@media (max-width: 991.98px) {

    .form-grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .form-card {
        padding: 1.3rem;
    }
}


/* ==========================================================================
   63. RESPONSIVE - MOBILE
   ========================================================================== */

@media (max-width: 767.98px) {

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;

        gap: 0.9rem;
    }

    .form-section {
        padding: 1.1rem;
    }

    .form-section-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 0.5rem;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .btn,
    .form-actions button {
        width: 100%;
    }

    .form-actions-between {
        align-items: stretch;
    }

    .profile-photo-upload {
        align-items: center;
        flex-direction: column;

        text-align: center;
    }

    .profile-photo-actions {
        align-items: center;
    }

    .form-steps {
        overflow-x: auto;

        padding-bottom: 0.5rem;
    }

    .form-step {
        min-width: 100px;
    }
}


/* ==========================================================================
   64. RESPONSIVE - SMALL MOBILE
   ========================================================================== */

@media (max-width: 575.98px) {

    .form-control,
    .form-select,
    input.form-control,
    textarea.form-control,
    select.form-control {
        min-height: 44px;

        font-size: 16px;
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 40px;

        font-size: 14px;
    }

    .form-card {
        padding: 1rem;

        border-radius: 12px;
    }

    .form-section {
        padding: 1rem;

        border-radius: 12px;
    }

    .form-option-cards {
        grid-template-columns: 1fr;
    }

    .range-fields,
    .age-range,
    .height-range {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            minmax(0, 1fr);
    }

    .otp-inputs,
    .otp-group {
        gap: 0.35rem;
    }

    .otp-input,
    .otp-group .form-control {
        width: 42px;
        height: 48px;

        flex-basis: 42px;
    }

    .file-upload,
    .upload-area,
    .dropzone {
        min-height: 140px;

        padding: 1.2rem 0.8rem;
    }

    .document-upload-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   65. VERY SMALL MOBILE
   ========================================================================== */

@media (max-width: 390px) {

    .otp-input,
    .otp-group .form-control {
        width: 38px;
        height: 45px;

        flex-basis: 38px;

        font-size: 1rem;
    }

    .tag-options,
    .interest-options {
        gap: 0.4rem;
    }

    .tag-option label,
    .interest-option label {
        min-height: 34px;

        padding: 0.4rem 0.65rem;

        font-size: 0.7rem;
    }
}


/* ==========================================================================
   66. TOUCH DEVICES
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {

    .form-control,
    .form-select,
    .form-check-label,
    .tag-option label,
    .interest-option label,
    .form-option-card label {
        touch-action: manipulation;
    }

    .form-check-input {
        width: 20px;
        height: 20px;

        flex-basis: 20px;
    }

    .form-switch .form-check-input {
        width: 44px;
        height: 24px;

        flex-basis: 44px;
    }
}


/* ==========================================================================
   67. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .form-control,
    .form-select,
    .form-check-input,
    .form-switch .form-check-input::before,
    .password-toggle,
    .search-input-clear,
    .search-field-clear,
    .file-upload,
    .upload-area,
    .dropzone,
    .tag-option label,
    .interest-option label,
    .form-option-card label,
    .form-completion-bar,
    .document-upload-card {
        transition: none !important;
    }
}


/* ==========================================================================
   68. PRINT
   ========================================================================== */

@media print {

    .form-control,
    .form-select,
    .form-section,
    .form-card,
    .form-fieldset {
        border-color: #cccccc !important;

        background: #ffffff !important;

        box-shadow: none !important;
    }

    .form-actions,
    .password-toggle,
    .file-upload,
    .upload-area,
    .dropzone {
        display: none !important;
    }

    textarea.form-control {
        resize: none;
    }
}