/* ===== Agnito Popups ===== */

.agnito-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.agnito-popup-overlay.agnito-active {
    display: flex;
    animation: agnitoFadeIn 0.22s ease;
}

@keyframes agnitoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.agnito-popup-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    box-sizing: border-box;
    /* blue gradient top border */
    border-top: 4px solid transparent;
    background-clip: padding-box;
    outline: none;
    animation: agnitoSlideUp 0.25s ease;
}

@keyframes agnitoSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Gradient top stripe via pseudo-element */
.agnito-popup-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, #1a3bc1 0%, #4f7cff 50%, #7ab8ff 100%);
}

/* Close button */
.agnito-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.agnito-popup-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Title */
.agnito-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    padding-right: 36px;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Description */
.agnito-popup-desc {
    font-size: 13.5px;
    color: #475569;
    margin: 0 0 22px;
    line-height: 1.55;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Form layout */
.agnito-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agnito-row {
    display: flex;
    gap: 12px;
}

.agnito-field {
    flex: 1;
    min-width: 0;
}

.agnito-field.agnito-full {
    flex: 1 1 100%;
}

/* Inputs, selects, textareas */
.agnito-field input,
.agnito-field select,
.agnito-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: #eef3fc;
    border: 1.5px solid #eef3fc;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    appearance: none;
    -webkit-appearance: none;
}

.agnito-field input::placeholder,
.agnito-field textarea::placeholder {
    color: #94a3b8;
}

.agnito-field select {
    color: #94a3b8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.agnito-field select option {
    color: #1e293b;
}

.agnito-field select.has-value {
    color: #1e293b;
}

.agnito-field input:focus,
.agnito-field select:focus,
.agnito-field textarea:focus {
    border-color: #3b6af5;
    background: #f0f6ff;
    box-shadow: 0 0 0 3px rgba(59, 106, 245, 0.1);
}

.agnito-field textarea {
    resize: vertical;
    min-height: 90px;
}

/* Submit button */
.agnito-submit-btn {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, #1a3bc1 0%, #2d5be3 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.18s, transform 0.18s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.agnito-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.agnito-submit-btn:active {
    transform: translateY(0);
}

.agnito-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Success / error message */
.agnito-form-msg {
    font-size: 13.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 8px;
    padding: 0;
    transition: all 0.2s;
}

.agnito-form-msg.agnito-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    padding: 12px 14px;
    text-align: center;
}

.agnito-form-msg.agnito-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 12px 14px;
    text-align: center;
}

/* Prevent body scroll when popup is open */
body.agnito-popup-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 560px) {
    .agnito-popup-card {
        padding: 28px 18px 22px;
        border-radius: 14px;
    }
    .agnito-row {
        flex-direction: column;
        gap: 10px;
    }
    .agnito-popup-title {
        font-size: 19px;
    }
}
