:root {
    --cm-blue: #1d8fce;
    --cm-blue-hover: #166ba1;
    --mp-gray-bg: #ebebeb;
    --mp-gray-card: #ffffff;
    --mp-text-primary: #333333;
    --mp-text-secondary: #999999;
    --mp-border: #e5e5e5;
    --mp-link: #1d8fce;
}

body.login-mp-page {
    background-color: var(--mp-gray-bg) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: var(--mp-text-primary);
    padding-bottom: 0 !important;
}

.mp-header {
    background-color: var(--cm-blue);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.mp-logo { height: 32px; object-fit: contain; }

.login-mp-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.login-card-wrapper { width: 100%; max-width: 424px; }

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: var(--mp-text-primary);
}

.mp-card {
    background-color: var(--mp-gray-card);
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.15);
    padding: 48px 48px 32px 48px;
    margin-bottom: 24px;
}

.mp-form-group { margin-bottom: 32px; position: relative; }

.mp-label {
    display: block;
    font-size: 14px;
    color: var(--mp-text-primary);
    margin-bottom: 8px;
    font-weight: 400;
}

.mp-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--mp-border);
    border-radius: 6px;
    padding: 0 16px;
    font-size: 16px;
    color: var(--mp-text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.mp-input:focus {
    border-color: var(--mp-link);
    box-shadow: 0 0 0 2px rgba(29, 143, 206, 0.2);
}

.mp-input::placeholder { color: #bfbfbf; }

.mp-input.mp-input-error {
    border-color: #f23d4f;
    box-shadow: 0 0 0 2px rgba(242, 61, 79, 0.15);
}

.mp-field-error {
    color: #f23d4f;
    font-size: 13px;
    margin: -20px 0 20px 0;
    line-height: 1.35;
}

.mp-btn-primary {
    background-color: var(--mp-link);
    color: white;
    border: none;
    border-radius: 6px;
    height: 48px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-btn-primary:hover {
    background-color: var(--cm-blue-hover);
    color: white;
}

.mp-btn-secondary {
    background-color: transparent;
    color: var(--mp-link);
    border: none;
    border-radius: 6px;
    height: 48px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.mp-btn-secondary:hover {
    background-color: rgba(29, 143, 206, 0.1);
    color: var(--mp-link);
}

.mp-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--mp-text-secondary);
    font-size: 14px;
}

.mp-divider::before,
.mp-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--mp-border);
}

.mp-divider:not(:empty)::before { margin-right: .5em; }
.mp-divider:not(:empty)::after { margin-left: .5em; }

.social-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-btn-social {
    background-color: white;
    border: 1px solid var(--mp-border);
    color: var(--mp-text-primary);
    height: 48px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s;
    text-decoration: none;
    width: 100%;
}

.mp-btn-social:hover {
    background-color: #f5f5f5;
    color: var(--mp-text-primary);
}

.mp-btn-social img {
    width: 20px;
    margin-right: 12px;
}

.mp-help-link {
    text-align: center;
    display: block;
    color: var(--mp-link);
    font-size: 14px;
    text-decoration: none;
    margin-top: 24px;
    font-weight: 400;
}

.mp-help-link:hover { color: var(--cm-blue-hover); }

.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    padding: 12px 0;
    margin-bottom: 16px;
    cursor: pointer;
    text-decoration: none;
}

.security-item:hover .security-text { color: var(--cm-blue-hover); }

.security-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.security-text {
    font-size: 14px;
    color: var(--mp-text-primary);
    text-decoration: none;
}

.mp-footer {
    background-color: white;
    padding: 16px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--mp-text-secondary);
    border-top: 1px solid var(--mp-border);
    margin-top: auto;
}

.mp-footer a {
    color: var(--mp-text-primary);
    text-decoration: none;
    margin: 0 10px;
}

.recaptcha-text {
    display: block;
    margin-top: 8px;
    color: #ccc;
}

.recaptcha-text a {
    color: var(--mp-link);
    margin: 0 4px;
}

.mp-subtitle {
    font-size: 14px;
    color: var(--mp-text-secondary);
    margin: -12px 0 24px 0;
    text-align: center;
    line-height: 1.5;
}

.mp-alert {
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.4;
}

.mp-alert-danger {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.mp-alert-warning {
    background: #fffbf0;
    border: 1px solid #ffeeba;
    color: #856404;
}

.mp-alert-success {
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.mp-alert strong { display: block; margin-bottom: 4px; }

.mp-password-wrap { position: relative; }

.mp-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--mp-text-secondary);
    padding: 4px;
    cursor: pointer;
    z-index: 2;
}

.mp-input-otp {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.4em;
}

.mp-link-inline {
    color: var(--mp-link);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.mp-link-inline:hover { color: var(--cm-blue-hover); }

.mp-text-center { text-align: center; }
.mp-mt-16 { margin-top: 16px; }
.mp-mb-0 { margin-bottom: 0 !important; }

.mp-subtitle-after-chip {
    margin: 12px 0 16px 0;
    font-size: 14px;
    color: var(--mp-text-secondary);
    text-align: center;
    line-height: 1.5;
}

.mp-user-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid var(--mp-border);
    border-radius: 6px;
    margin-bottom: 0;
    font-size: 14px;
}

.mp-user-chip-email {
    color: var(--mp-text-primary);
    word-break: break-all;
    flex: 1;
}

.login-mp-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.fade-in { animation: cmFadeIn 0.4s ease-in-out; }

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

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner-cuotin {
    width: 3.5rem;
    height: 3.5rem;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1d8fce;
    border-radius: 50%;
    animation: cmSpin 0.8s linear infinite;
}

@keyframes cmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .mp-card {
        padding: 32px 24px;
        box-shadow: none;
        background-color: transparent;
    }
    .login-mp-main {
        padding: 20px 16px;
        background-color: white;
    }
    body.login-mp-page { background-color: white !important; }
    .page-title {
        font-size: 22px;
        text-align: left;
    }
}
