/* Vistas /auth: layout partido (marca + formulario), sin panel */

.mg-auth-body {
    margin: 0;
    min-height: 100vh;
    background: #f4f6f9;
    color: var(--mg-grey);
}

[data-theme="dark"] .mg-auth-body {
    background: #0f1115;
    color: var(--mg-grey);
}

/* Layout en dos columnas */
.mg-auth-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
    align-items: stretch;
}

.mg-auth-brand-col {
    flex: 0 0 50%;
    width: 50%;
    max-width: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2rem 1.75rem;
    box-sizing: border-box;
    background: linear-gradient(155deg, #1e1a2e 0%, #2d2640 42%, #17151f 100%);
    color: rgba(255, 255, 255, 0.92);
    position: relative;
    overflow: hidden;
}

.mg-auth-brand-col::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 20% 20%, rgba(220, 38, 38, 0.12), transparent 55%),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(99, 102, 241, 0.15), transparent 50%);
    pointer-events: none;
}

.mg-auth-brand-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.mg-auth-brand-logo-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.mg-auth-brand-logo {
    max-width: min(300px, 92%);
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.mg-auth-brand-tagline {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    max-width: 320px;
    letter-spacing: -0.01em;
}

.mg-auth-brand-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.mg-auth-panel-col {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    min-height: 100vh;
}

[data-theme="dark"] .mg-auth-panel-col {
    background: #0f1115;
}

.mg-auth-topbar--panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 1rem 1.5rem;
    box-sizing: border-box;
}

.mg-auth-topbar-spacer {
    flex: 1;
}

.mg-auth-header-cta {
    border-radius: 999px;
    font-weight: 500;
    padding: 0.4rem 1rem;
}

.mg-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem 2.5rem;
    box-sizing: border-box;
}

.mg-auth-card-wrap {
    width: 100%;
    max-width: 440px;
}

/* Tarjeta “flotante” sin marco: se funde con el panel */
.mg-auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 2rem 2rem 1.75rem;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}

[data-theme="dark"] .mg-auth-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Compat: layout antiguo si se reutiliza .mg-auth-shell en otro sitio */
.mg-auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 2rem;
    box-sizing: border-box;
}

.mg-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto 0.5rem;
}

.mg-auth-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mg-auth-logo-img--dark {
    display: none;
}

[data-theme="dark"] .mg-auth-logo-img--light {
    display: none;
}

[data-theme="dark"] .mg-auth-logo-img--dark {
    display: block;
    filter: brightness(0) invert(1);
}

.mg-auth-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mg-auth-theme-btn {
    color: var(--mg-grey-100) !important;
    text-decoration: none !important;
    padding: 0.35rem 0.5rem !important;
}

[data-theme="dark"] .mg-auth-theme-btn {
    color: var(--mg-grey-100) !important;
}


.mg-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    color: var(--mg-grey);
}

[data-theme="dark"] .mg-auth-title {
    color: var(--mg-grey);
}

.mg-auth-subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: var(--mg-secondary);
    margin: 0 0 1.5rem;
    line-height: 1.45;
}

[data-theme="dark"] .mg-auth-subtitle {
    color: var(--mg-lavanda-500);
}

.mg-auth-hint {
    font-size: 0.9rem;
    color: var(--mg-grey-100);
    text-align: center;
}

[data-theme="dark"] .mg-auth-hint {
    color: var(--mg-grey-100);
}

.mg-auth-btn-social {
    border-radius: 12px;
    min-height: 44px;
    border: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .mg-auth-btn-social {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.88) !important;
    box-shadow: none;
}

.mg-auth-btn-social:hover {
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .mg-auth-btn-social:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.mg-auth-sep {
    text-align: center;
    font-size: 0.85rem;
    color: var(--mg-secondary);
    margin: 0 0 1rem;
    position: relative;
}

.mg-auth-sep span {
    background: #f4f6f9;
    padding: 0 0.75rem;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .mg-auth-sep span {
    background: #0f1115;
}

.mg-auth-sep::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
    z-index: 0;
}

[data-theme="dark"] .mg-auth-sep::before {
    background: rgba(255, 255, 255, 0.08);
}

.mg-auth-link-row {
    text-align: center;
}

.mg-auth-link-row a {
    font-weight: 500;
}

.mg-auth-legal {
    line-height: 1.5;
    text-align: center;
}

.mg-auth-footer {
    max-width: 520px;
    margin: 0 auto;
    padding-top: 1rem;
    line-height: 1.4;
}

.mg-auth-card .form-control {
    border-radius: 12px;
    border: none !important;
    padding: 0.65rem 0.95rem;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mg-auth-card .form-control:focus {
    border: none !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
    background: #fff;
}

[data-theme="dark"] .mg-auth-card .form-control {
    background: rgba(255, 255, 255, 0.06);
    color: var(--mg-grey);
    box-shadow: none;
}

[data-theme="dark"] .mg-auth-card .form-control:focus {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
    background: rgba(255, 255, 255, 0.09);
}

.mg-auth-card .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    color: var(--mg-grey-100);
}

.mg-auth-card .btn-primary {
    min-height: 48px;
    font-weight: 600;
    border-radius: 12px;
    border: none !important;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.28);
}

.mg-auth-card .btn-primary:hover,
.mg-auth-card .btn-primary:focus {
    border: none !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

.mg-auth-card .input-group {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .mg-auth-card .input-group {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.mg-auth-card .input-group:focus-within {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
    background: #fff;
}

[data-theme="dark"] .mg-auth-card .input-group:focus-within {
    background: rgba(255, 255, 255, 0.09);
}

.mg-auth-card .input-group .form-control {
    box-shadow: none !important;
    background: transparent !important;
}

.mg-auth-card .input-group .form-control:focus {
    box-shadow: none !important;
    background: transparent !important;
}

.mg-auth-card .input-group .btn {
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    color: var(--mg-secondary);
    transform: none !important;
}

[data-theme="dark"] .mg-auth-card .input-group .btn {
    color: rgba(255, 255, 255, 0.65);
}

/* intl-tel-input en tema oscuro */
[data-theme="dark"] .mg-auth-card .iti__country-list {
    background: var(--mg-white);
    border-color: var(--mg-white-200);
}

[data-theme="light"] .mg-auth-body .mG_invalid,
.mg-auth-body .mG_invalid {
    border: none !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.45) !important;
}

.mg-auth-card .input-group:has(.mG_invalid):focus-within {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.45);
}

/* Página 404 (layout propio, sin panel) */
.mg-error-page-card {
    max-width: 28rem;
    padding: 0 1rem;
}

.mg-error-page-code {
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.75rem;
    color: var(--mg-primary);
    letter-spacing: -0.04em;
}

/* Móvil / tablet estrecha: solo formulario (sin columna de marca) */
@media (max-width: 991px) {
    .mg-auth-layout {
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .mg-auth-brand-col {
        display: none !important;
    }

    .mg-auth-panel-col {
        width: 100%;
        flex: 1 1 auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .mg-auth-main {
        flex: 1;
        justify-content: flex-start;
        padding: 0.75rem 1rem 2rem;
        width: 100%;
    }

    .mg-auth-card-wrap {
        max-width: 100%;
    }

    .mg-auth-card {
        padding: 1.25rem 1rem 1.5rem;
    }

    .mg-auth-topbar--panel {
        padding: 0.75rem 1rem;
    }
}
