:root {
    --mcn-primary: #4f46e5;
    --mcn-primary-hover: color-mix(in srgb, var(--mcn-primary) 85%, black);
    --mcn-border: #d1d5db;
    --mcn-text: #111827;
    --mcn-muted: #6b7280;
    --mcn-radius: 4px;
    --mcn-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
}

.mcn-form {
    width: 100%;
    max-width: 480px;
    color: inherit;
}

.mcn-field {
    display: flex;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.mcn-input {
    flex: 1;
    border: 1px solid var(--mcn-border);
    outline: 0;
    background: white;
    border-radius: var(--mcn-radius);
    padding: 12px 14px !important;
    font-size: 15px !important;
    font-family: inherit;
    color: inherit;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mcn-input:focus {
    border-color: var(--mcn-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mcn-primary) 18%, transparent);
}

.mcn-input::placeholder {
    color: var(--mcn-muted);
}

.mcn-button {
    position: relative;
    border: 0;
    cursor: pointer;
    background: var(--mcn-primary);
    color: #fff;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--mcn-radius);
    transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.mcn-button:hover:not(:disabled) {
    background: var(--mcn-primary-hover);
    transform: translateY(-1px);
}

.mcn-button:active {
    transform: translateY(0);
}

.mcn-button:disabled {
    opacity: 0.75;
    cursor: wait;
}

.mcn-button__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mcn-spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.mcn-button.is-loading .mcn-button__spinner {
    display: inline-block;
}

@keyframes mcn-spin {
    to { transform: rotate(360deg); }
}

.mcn-message {
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
    color: var(--mcn-muted);
    transition: color 0.2s ease;
}

.mcn-message.is-success { color: #059669; }
.mcn-message.is-error { color: #dc2626; }

@media (max-width: 480px) {
    .mcn-field { flex-direction: column; }
    .mcn-button { width: 100%; justify-content: center; }
}

/* Popup */
.mcn-popup {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.mcn-popup[hidden] { display: none; }

.mcn-popup__dialog {
    position: relative;
    background: #fff;
    color: var(--mcn-text);
    border-radius: 10px;
    padding: 20px 22px 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    animation: mcn-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
    pointer-events: auto;
}

@media (max-width: 480px) {
    .mcn-popup {
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
    }
}

.mcn-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 0;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--mcn-muted);
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, color 0.2s ease;
}

.mcn-popup__close:hover {
    background: #e5e7eb;
    color: var(--mcn-text);
}

.mcn-popup__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--mcn-text);
    padding-right: 36px;
    position: relative;
    z-index: 1;
}

.mcn-popup__text {
    margin: 0 0 14px;
    color: var(--mcn-muted);
    font-size: 14px;
    line-height: 1.5;
}

.mcn-popup .mcn-form { max-width: 100%; }
.mcn-popup .mcn-message { min-height: 0; margin-top: 6px; }
.mcn-popup .mcn-message:empty { margin-top: 0; }

@keyframes mcn-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
