/**
 * Gravity Forms Custom Styling
 *
 * Base form styles for all Gravity Forms site-wide.
 * These styles work in conjunction with the floating labels feature.
 *
 * @package UnqorkElementorAddon
 * @since 1.0.0
 */

/* --------- Form wrapper baseline --------- */
.gform_wrapper {
    /* keep background as your theme wants; everything inside we style */
    color: #ffffff; /* default text color */
    font-family: inherit;
}

/* --------- Labels: show above fields, white, clear spacing --------- */
.gform_wrapper .gfield_label {
    display: block !important;
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.1;
}

/* --------- Inputs / Textareas / Email fields: transparent background, white text --------- */
.gform_wrapper .gfield input[type="text"],
.gform_wrapper .gfield input[type="email"],
.gform_wrapper .gfield input[type="tel"],
.gform_wrapper .gfield input[type="url"],
.gform_wrapper .gfield textarea {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.9); /* white border */
    color: #ffffff !important;   /* typed text color */
}

/* Placeholder color (muted) */
.gform_wrapper .gfield input::placeholder,
.gform_wrapper .gfield textarea::placeholder {
    color: rgba(255,255,255,0.55) !important;
}

/* --------- Select dropdown styling --------- */
.gform_wrapper .gfield select {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.9);
    color: #ffffff !important;
    background-image: linear-gradient(45deg, transparent 50%, #549bd9 50%),
                      linear-gradient(135deg, #549bd9 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 12px) calc(1em + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* --------- Submit button --------- */
.gform_wrapper form .gform_footer input.gform_button[type="submit"],
.gform_wrapper form .gform_footer button.gform_button[type="submit"] {
    border-radius: 30px !important;
    background: #1C75BC !important;
    color: #ffffff !important;
    cursor: pointer;
    font-size: 16px;
    min-height: 46px !important;
    box-shadow: 0 6px 18px rgba(33,95,160,0.18);
    transition: all 0.3s ease;
}

.gform_wrapper form .gform_footer input.gform_button[type="submit"]:hover,
.gform_wrapper form .gform_footer button.gform_button[type="submit"]:hover {
    background: #27AAE1 !important;
    color: #0C2340 !important;
}

/* --------- Form footer spacing --------- */
.gform_footer {
    margin-top: 48px !important;
}

/* --------- Field spacing --------- */
.gform-theme--foundation .gform_fields {
    grid-row-gap: 15px !important;
}

/* ========================================================================
   FLOATING LABELS STYLES
   ======================================================================== */

/* Make gfield position relative for absolute label positioning */
.gfield {
    position: relative !important;
}

/* Position labels INSIDE the field (floating label effect) */
.gfield.gfield--type-text .gfield_label,
.gfield.gfield--type-email .gfield_label,
.gfield.gfield--type-phone .gfield_label,
.gfield.gfield--type-number .gfield_label,
.gfield.gfield--type-textarea .gfield_label,
.gfield.gfield--type-select .gfield_label {
    position: absolute !important;
    left: 12px !important;
    top: 22px !important;
    transform: translateY(0) !important;
    transition: all 0.3s ease !important;
    pointer-events: none !important;
    z-index: 2 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    /* Keep your existing color from custom CSS */
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

.gfield_label .gfield_required {
    line-height: 1 !important;
    vertical-align: baseline !important;
}

/* Add padding to inputs to make room for floating label */
.gfield input[type='text'],
.gfield input[type='email'],
.gfield input[type='tel'],
.gfield input[type='number'] {
    padding: 22px 12px 16px 12px !important;
    min-height: 60px !important;
    height: 60px !important;
    font-size: 16px !important;
}

.gfield textarea {
    padding: 28px 12px 12px 12px !important;
    min-height: 100px !important;
    font-size: 16px !important;
}

.gfield select {
    padding: 22px 40px 14px 12px !important;
    min-height: 60px !important;
    height: 60px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    line-height: normal !important;
    box-sizing: border-box !important;
}

/* Floating label when field is FOCUSED or HAS VALUE */
.gfield.has-value .gfield_label,
.gfield.is-focused .gfield_label {
    top: 8px !important;
    transform: translateY(0) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
}

/* Make label dull/gray when focused or has value */
.gfield.is-focused .gfield_label,
.gfield.has-value .gfield_label {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Special handling for select fields - always show label at top */
.gfield--type-select .gfield_label {
    top: 8px !important;
    transform: translateY(0) !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Show placeholder ONLY when field is focused and empty */
.gfield.is-focused input:placeholder-shown::placeholder,
.gfield.is-focused textarea:placeholder-shown::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

/* Keep label floated even when there's an error */
.gfield.gfield_error.has-value .gfield_label,
.gfield.gfield_error.is-focused .gfield_label {
    top: 8px !important;
    transform: translateY(0) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Error state - keep label visible and readable */
.gfield.gfield_error .gfield_label {
    z-index: 3 !important; /* Ensure label stays above error styling */
}

/* Validation message positioning - ensure it doesn't affect label */
.gfield_error .validation_message {
    margin-top: 8px !important;
    position: relative !important;
}

/* When error field is focused or has value, use standard dimmed color */
.gfield.gfield_error.has-value .gfield_label,
.gfield.gfield_error.is-focused .gfield_label {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ========================================================================
   FORM DISCLAIMER TEXT
   ======================================================================== */
.gform-disclaimer {
    font-size: 12px !important;
    line-height: 16px !important;
    margin-top: 50px !important;
    text-align: center !important;
    max-width: 425px !important;
    color: #85919F !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.gform-disclaimer a {
    color: #ffffff !important;
    text-decoration: none !important;
}
