/* ==========================================
   FORM ENHANCEMENTS - PHASE 3
   Input Glow, Validation States, Animations
   ========================================== */

/* Focus Glow Effects */
.modern-form .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.modern-form .form-group input:focus,
.modern-form .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px rgba(212, 163, 115, 0.1),
        0 0 20px rgba(212, 163, 115, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animated Border Pulse on Focus */
@keyframes borderPulse {

    0%,
    100% {
        box-shadow:
            0 0 0 3px rgba(212, 163, 115, 0.1),
            0 0 20px rgba(212, 163, 115, 0.3),
            0 0 0 0 rgba(212, 163, 115, 0.4);
    }

    50% {
        box-shadow:
            0 0 0 3px rgba(212, 163, 115, 0.1),
            0 0 20px rgba(212, 163, 115, 0.3),
            0 0 0 8px rgba(212, 163, 115, 0);
    }
}

.modern-form .form-group input:focus {
    animation: borderPulse 2s ease-in-out infinite;
}

/* ==========================================
   VALIDATION STATES
   ========================================== */

/* Error State */
.form-group.error input,
.form-group.error textarea {
    border-color: #DC2626 !important;
    background: #FEF2F2 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.error-message {
    color: #DC2626;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success State */
.form-group.success input,
.form-group.success textarea {
    border-color: #10B981 !important;
    background: #ECFDF5 !important;
}

.form-group.success::after {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #10B981;
    font-size: 1.3rem;
    font-weight: bold;
    animation: checkmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateY(-50%) scale(1.3);
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 300px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-success i {
    color: #10B981;
    font-size: 1.5rem;
}

.toast-error {
    border-left: 4px solid #DC2626;
}

.toast-error i {
    color: #DC2626;
    font-size: 1.5rem;
}

.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-info i {
    color: #3B82F6;
    font-size: 1.5rem;
}

.toast span {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Toast close button */
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-main);
}

/* Mobile Toast */
@media (max-width: 768px) {
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
}

/* ==========================================
   LOADING STATES FOR BUTTONS
   ========================================== */

.btn-gradient-primary.loading,
.btn-gradient-secondary.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn-gradient-primary.loading::after,
.btn-gradient-secondary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: buttonSpin 0.8s linear infinite;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   ENHANCED INPUT INTERACTIONS
   ========================================== */

/* Ripple effect on input click */
.form-group::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 163, 115, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.form-group.ripple::before {
    width: 300px;
    height: 300px;
}

/* Input label animation enhancement */
.modern-form .form-group label {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modern-form .form-group input:focus~label,
.modern-form .form-group input:not(:placeholder-shown)~label {
    color: var(--accent);
    font-weight: 600;
}

/* Character count for inputs */
.char-count {
    position: absolute;
    right: 12px;
    bottom: -24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.char-count.warning {
    color: #F59E0B;
}

.char-count.error {
    color: #DC2626;
}