/* ============================================================
   Floating Labels — BS5-style (Standalone, no BS5 required)
   Compatible with existing .form-claire inputs
   ============================================================ */

/* Container */
.form-floating {
    position: relative;
    margin-bottom: 0;
}

/* Input styling override */
.form-floating > .form-claire {
    height: 52px;
    padding: 20px 15px 6px 15px;
    line-height: 1.25;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 0;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100% !important;
    box-sizing: border-box;
    font-size: 14px;
}

.form-floating > textarea.form-claire {
    height: auto;
    min-height: 80px;
    padding-top: 24px;
}

.form-floating > select.form-claire {
    padding-top: 20px;
    padding-bottom: 6px;
}

/* Label — default state (acts as placeholder) */
.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 14px 15px;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out, color 0.15s ease-in-out;
    color: rgba(0,0,0,0.45);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
}

/* Floating state — on focus or when has value */
.form-floating > .form-claire:focus ~ label,
.form-floating > .form-claire:not(:placeholder-shown) ~ label,
.form-floating > .form-claire.has-value ~ label,
.form-floating.is-filled > label {
    opacity: 0.85;
    transform: scale(0.78) translateY(-8px);
    color: #be485a;
    font-weight: 500;
}

/* Focus state — border highlight */
.form-floating > .form-claire:focus {
    border-color: #be485a;
    box-shadow: 0 0 0 2px rgba(190, 72, 90, 0.12);
    outline: none;
}

/* Hide native placeholder when using floating label */
.form-floating > .form-claire::placeholder {
    color: transparent;
}
.form-floating > .form-claire:focus::placeholder {
    color: transparent;
}

/* Error state */
.form-floating.has-error > .form-claire {
    border-color: #d9534f;
}
.form-floating.has-error > label {
    color: #d9534f;
}

/* Disabled state */
.form-floating > .form-claire:disabled,
.form-floating > .form-claire.disabled {
    background-color: rgba(0,0,0,0.04);
    cursor: not-allowed;
}
.form-floating > .form-claire:disabled ~ label {
    opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .form-floating > .form-claire {
        height: 48px;
        padding: 18px 12px 4px 12px;
        font-size: 16px !important; /* prevent iOS zoom */
    }
    .form-floating > label {
        padding: 13px 12px;
        font-size: 13px;
    }
    .form-floating > .form-claire:focus ~ label,
    .form-floating > .form-claire:not(:placeholder-shown) ~ label,
    .form-floating.is-filled > label {
        transform: scale(0.75) translateY(-7px);
    }
    .form-floating > textarea.form-claire {
        min-height: 70px;
        padding-top: 22px;
    }
}

/* ---- Login form specific ---- */
#box-login .form-floating {
    margin-bottom: 12px;
}
#box-login .form-floating > .form-claire {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    background: transparent;
    border-radius: 0;
}
#box-login .form-floating > .form-claire:focus {
    border-bottom-color: #be485a;
    box-shadow: 0 1px 0 0 #be485a;
}
#box-login .form-floating > label {
    padding-left: 0;
}

/* ---- Register & Checkout forms ---- */
.format-form .form-floating,
.container-member .form-floating {
    margin-bottom: 0;
}
.format-form .form-floating > .form-claire,
.container-member .form-floating > .form-claire {
    border-radius: 2px;
}

/* When used inside .col-input (existing layout) */
.col-input > .form-floating {
    width: 100%;
}
/* Hide original .col-label when floating label is active */
.row-form.use-floating > .group-form > .col-label {
    display: none !important;
}
.row-form.use-floating > .group-form > .col-input {
    width: 100% !important;
    padding-left: 0 !important;
}

/* ---- Textarea floating ---- */
.form-floating > textarea.form-claire:focus ~ label,
.form-floating > textarea.form-claire:not(:placeholder-shown) ~ label {
    background: linear-gradient(to bottom, #fff 50%, transparent 50%);
    padding-top: 2px;
    padding-bottom: 0;
}

/* ---- Smooth animation for icon-mark labels ---- */
.row-form .icon-mark {
    position: relative;
    padding-left: 15px;
}
.row-form .icon-mark::before {
    content: "*";
    position: absolute;
    left: 0;
    color: #be485a;
    font-weight: bold;
}
