/* ==========================================================================
   Awwwards-Level Validation Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes inputShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

@keyframes labelMorph {
    0% {
        transform: translateY(-100%) scale(0.75);
        opacity: 0;
    }

    30% {
        transform: translateY(0) scale(0.75);
        opacity: 1;
    }

    80% {
        transform: translateY(0) scale(0.75);
        opacity: 1;
    }

    100% {
        transform: translateY(-24px) scale(0.75);
        opacity: 0;
    }

    /* For swapping back */
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   State Classes
   -------------------------------------------------------------------------- */

/* Error Shake */
.input-shake {
    animation: inputShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Error State Input */
.input-error {
    border-color: #ef4444 !important;
    /* Tailwind red-500 */
    color: #ef4444 !important;
}

.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1), 0 2px 4px -1px rgba(239, 68, 68, 0.06);
}

/* Label Handling */
.label-error {
    color: #ef4444 !important;
    /* Tailwind red-500 */
    font-weight: 600;
}

/* Success State Input */
.input-success {
    border-color: #ffffff !important;
}

.input-success:focus {
    border-color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1), 0 2px 4px -1px rgba(255, 255, 255, 0.06);
}

/* Success Icon */
.success-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    pointer-events: none;
    animation: checkmarkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --------------------------------------------------------------------------
   Enhanced Floating Label logic reuse
   -------------------------------------------------------------------------- */
/* 
   We reuse the existing peer-placeholder-shown logic but augment it 
   with specific validation overrides 
*/

.group.error .peer-placeholder-shown~label {
    color: #ef4444;
}

/* Smoother transitions for labels */
label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* --------------------------------------------------------------------------
   Start Project Multi-step Indicator Validation
   -------------------------------------------------------------------------- */
.step-indicator.error .step-dot {
    background-color: #ef4444 !important;
}

.step-indicator.error .step-label {
    color: #ef4444 !important;
}

/* --------------------------------------------------------------------------
   Custom Checkbox/Radio Validation (Start Project Form)
   -------------------------------------------------------------------------- */
/* Target the visible sibling div when the hidden input has an error */
input.peer.input-error.sr-only+div,
input.peer.input-error.hidden+div {
    border-color: #ef4444 !important;
    animation: inputShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Success state for custom inputs */
/* Success state for custom inputs - only when checked */
input.peer.input-success:checked.sr-only+div,
input.peer.input-success:checked.hidden+div {
    border-color: #ffffff !important;
}