/* Button spinner */
.spinner{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;margin-right:8px;vertical-align:-2px;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Popup message */
.popup-message{position:fixed;left:50%;top:20px;transform:translateX(-50%) scale(.95);z-index:9999;min-width:280px;max-width:90vw;padding:14px 16px;border-radius:10px;display:flex;align-items:center;gap:10px;color:#fff;box-shadow:0 12px 30px rgba(0,0,0,.25);opacity:0;animation:popup-in .35s ease forwards}
.popup-message .popup-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.2);border-radius:50%;font-weight:700}
.popup-success{background:linear-gradient(135deg,#1fbf75,#18a864)}
.popup-error{background:linear-gradient(135deg,#e84c3d,#c0392b)}
@keyframes popup-in{from{opacity:0;transform:translateX(-50%) translateY(-6px) scale(.95)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
@keyframes popup-out{to{opacity:0;transform:translateX(-50%) translateY(-6px) scale(.98)}}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form styles */
.form-control.error {
    border-color: #ff0000;
    animation: shake 0.5s;
}

/* Alert styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Form field animations */
.form-field input,
.form-field select,
.form-field textarea {
    transition: all 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Popup Messages */
.custom-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 20px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.custom-popup.show {
    transform: translateX(0);
}

.custom-popup.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.custom-popup.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.popup-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.success .popup-icon {
    background: #28a745;
    color: white;
}

.error .popup-icon {
    background: #dc3545;
    color: white;
}

.popup-content {
    flex: 1;
    font-size: 14px;
}

.popup-hide {
    animation: slideOut 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Form field error state */
.form-control.error {
    border-color: #dc3545;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.sweet-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.sweet-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.sweet-popup.success {
    border-top: 6px solid #28a745;
}

.sweet-popup.error {
    border-top: 6px solid #dc3545;
}

.sweet-popup-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.success .sweet-popup-icon {
    color: #28a745;
}

.error .sweet-popup-icon {
    color: #dc3545;
}

.sweet-popup-message {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.sweet-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.sweet-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}