/* =============================================================
   CIS - Auth Design System
   Paleta:
     Primario:  #4f46e5  (indigo) | #7c3aed (violeta)
     Acento:    #f97316  (naranja cálido) | #f59e0b (ámbar)
     Superficie: #ffffff + glassmorphism
     Neutros:   #0f172a / #475569 / #94a3b8 / #e2e8f0 / #f1f5f9
   ============================================================= */

:root {
    --c-primary:        #4f46e5;
    --c-primary-dark:   #3730a3;
    --c-primary-soft:   #eef2ff;
    --c-accent:         #f97316;
    --c-accent-2:       #f59e0b;
    --c-success:        #10b981;
    --c-danger:         #ef4444;
    --c-text:           #0f172a;
    --c-text-muted:     #64748b;
    --c-border:         #e2e8f0;
    --c-bg:             #f8fafc;
    --c-card:           #ffffff;
    --c-input-bg:       #f8fafc;

    --shadow-sm:  0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md:  0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg:  0 24px 48px -12px rgba(15, 23, 42, .25);
    --shadow-primary: 0 12px 28px -8px rgba(79, 70, 229, .45);

    --radius-sm: 10px;
    --radius:    14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --tr-fast:  .15s ease;
    --tr:       .25s cubic-bezier(.4, 0, .2, 1);
    --tr-slow:  .5s cubic-bezier(.4, 0, .2, 1);
}

/* ----- Reset / Base ----- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a { color: var(--c-primary); text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--c-primary-dark); }

/* ----- Fondo animado: blobs + grid ----- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 100% 0%, #eef2ff 0%, transparent 60%),
        radial-gradient(900px 500px at 0% 100%, #fff7ed 0%, transparent 55%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    animation: float 18s ease-in-out infinite;
    will-change: transform;
}
.blob-1 { width: 480px; height: 480px; top: -120px; left: -120px; background: radial-gradient(circle, #818cf8 0%, transparent 70%); }
.blob-2 { width: 520px; height: 520px; bottom: -160px; right: -100px; background: radial-gradient(circle, #fdba74 0%, transparent 70%); animation-delay: -6s; }
.blob-3 { width: 360px; height: 360px; top: 40%; left: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #c4b5fd 0%, transparent 70%); animation-delay: -12s; opacity: .35; }

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.05); }
    66%      { transform: translate(-30px, 30px) scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none; }
}

/* ----- Layout ----- */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch;
}

/* Panel izquierdo: branding */
.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.18) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.10) 0%, transparent 40%),
        linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
    overflow: hidden;
    isolation: isolate;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}

.brand-inner {
    position: relative;
    max-width: 480px;
    width: 100%;
    z-index: 1;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    margin-bottom: 32px;
    transition: transform var(--tr);
}
.brand-logo:hover { color: #fff; transform: translateY(-2px); }
.brand-logo img {
    width: 56px; height: 56px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    background: #fff;
}
.brand-logo::after {
    content: 'CIS';
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .5px;
}

.brand-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.brand-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 16px;
    letter-spacing: -.02em;
}

.brand-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .85);
    margin: 0 0 32px;
}

.brand-features {
    list-style: none;
    padding: 0;
    margin: 0 0 40px;
    display: grid;
    gap: 14px;
}
.brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, .92);
}
.brand-features i {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 14px;
}

.brand-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    margin-top: 24px;
}
.brand-footer a { color: rgba(255, 255, 255, .9); }
.brand-footer a:hover { color: #fff; }
.brand-footer .dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.4); }

/* Panel derecho: contenido */
.auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 32px;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--c-card);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(15, 23, 42, .04);
    position: relative;
    overflow: hidden;
    animation: cardIn .6s cubic-bezier(.16, 1, .3, 1) both;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 100%);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header { margin-bottom: 28px; }
.auth-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 8px;
    letter-spacing: -.01em;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--c-text-muted);
    margin: 0;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--c-text-muted);
}
.auth-footer a { font-weight: 600; }

.auth-legal {
    margin: 24px 0 0;
    font-size: 12px;
    color: var(--c-text-muted);
    text-align: center;
}

/* ----- Formularios ----- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 8px;
    letter-spacing: .01em;
}

.form-control,
.form-control-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 46px;
    font-size: 15px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-input-bg);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    transition: border-color var(--tr), box-shadow var(--tr), background var(--tr), transform var(--tr-fast);
    outline: none;
}

.form-control::placeholder { color: #94a3b8; }

.form-control:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.form-control:focus,
.form-control-wrap input:focus {
    border-color: var(--c-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.form-control.is-invalid,
.has-error .form-control-wrap input {
    border-color: var(--c-danger);
    background: #fef2f2;
}
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }

.invalid-feedback {
    display: block;
    font-size: 12.5px;
    color: var(--c-danger);
    margin-top: 6px;
    font-weight: 500;
}

/* Input wrapper con icono + toggle */
.form-control-wrap {
    position: relative;
    width: 100%;
    display: block;
}
.form-control-wrap .form-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    transition: color var(--tr);
}
.form-control-wrap input {
    padding-left: 42px !important;
    position: relative;
    z-index: 1;
}
.form-control-wrap input:focus ~ .form-icon,
.form-control-wrap input:focus + .form-icon { color: var(--c-primary); }
.form-control-wrap input.has-toggle-right { padding-right: 48px !important; }

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 10px;
    cursor: pointer;
    transition: color var(--tr-fast), background var(--tr-fast);
    padding: 0;
}
.password-toggle:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.password-toggle:focus { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.password-toggle i { font-size: 14px; transition: transform var(--tr); }
.password-toggle:hover i { transform: scale(1.1); }

/* Checkbox custom */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}
.form-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all var(--tr);
    flex-shrink: 0;
}
.form-check input[type="checkbox"]:hover { border-color: var(--c-primary); }
.form-check input[type="checkbox"]:checked {
    background: var(--c-primary);
    border-color: var(--c-primary);
}
.form-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 6px; height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form-check input[type="checkbox"]:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); outline: none; }
.form-check label { font-size: 14px; color: var(--c-text-muted); cursor: pointer; margin: 0; }

/* Password strength meter */
.password-strength {
    display: none;
    margin-top: 10px;
}
.password-strength.is-active { display: block; animation: fadeIn .25s ease; }
.password-strength .bar-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
.password-strength .bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width var(--tr), background var(--tr);
}
.password-strength .bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--c-text-muted);
}
.password-strength .bar-label strong { color: var(--c-text); font-weight: 600; }
.password-strength.is-weak   .bar-fill { background: #ef4444; }
.password-strength.is-fair   .bar-fill { background: #f59e0b; }
.password-strength.is-good   .bar-fill { background: #3b82f6; }
.password-strength.is-strong .bar-fill { background: #10b981; }
.password-strength.is-weak   .bar-label strong   { color: #ef4444; }
.password-strength.is-fair   .bar-label strong   { color: #f59e0b; }
.password-strength.is-good   .bar-label strong   { color: #3b82f6; }
.password-strength.is-strong .bar-label strong   { color: #10b981; }

/* Match indicator */
.password-match {
    display: none;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--c-text-muted);
}
.password-match.is-shown { display: flex; align-items: center; gap: 6px; }
.password-match.is-match    { color: var(--c-success); }
.password-match.is-mismatch { color: var(--c-danger); }

/* Alertas / errores */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn .3s ease;
}
.alert .alert-icon { flex-shrink: 0; line-height: 1.4; }
.alert ul { margin: 4px 0 0 0; padding-left: 18px; }
.alert-success { background: #ecfdf5; color: #065f46; border-left: 3px solid #10b981; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 3px solid #f59e0b; }
.alert-info    { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }
.alert-default-success { background: #ecfdf5; color: #065f46; }
.alert-default-warning { background: #fffbeb; color: #92400e; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Botón principal */
.btn-primary-solid {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--c-primary) 0%, #6366f1 50%, var(--c-primary) 100%);
    background-size: 200% 100%;
    background-position: 0% 0%;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--tr), box-shadow var(--tr), background-position var(--tr-slow);
    box-shadow: var(--shadow-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-primary-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -8px rgba(79, 70, 229, .55);
    background-position: 100% 0%;
}
.btn-primary-solid:active { transform: translateY(0); }
.btn-primary-solid:focus-visible { outline: 3px solid rgba(79, 70, 229, .3); outline-offset: 2px; }
.btn-primary-solid[disabled] { opacity: .7; cursor: not-allowed; transform: none; }

.btn-primary-solid .btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-primary-solid.is-loading .btn-spinner { display: inline-block; }
.btn-primary-solid.is-loading .btn-label,
.btn-primary-solid.is-loading .btn-icon { display: none; }

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

/* Botón link */
.btn-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-primary);
    font-weight: 600;
    font-size: 13.5px;
    transition: gap var(--tr);
}
.btn-link-inline:hover { gap: 10px; color: var(--c-primary-dark); }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 20px;
    flex-wrap: wrap;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--c-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

/* Texto de ayuda */
.form-hint {
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin-top: 6px;
}

/* Back to login */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color var(--tr-fast), gap var(--tr-fast);
}
.auth-back:hover { color: var(--c-primary); gap: 12px; }

/* Verify card */
.verify-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%);
    color: var(--c-primary);
    font-size: 30px;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px -8px rgba(79, 70, 229, .35);
    animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 24px -8px rgba(79, 70, 229, .35); }
    50%      { box-shadow: 0 8px 32px -4px rgba(79, 70, 229, .55); }
}
.verify-text { text-align: center; color: var(--c-text-muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.verify-actions { text-align: center; margin-top: 12px; }

/* Responsive */
@media (max-width: 992px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-brand { padding: 32px 24px; min-height: auto; }
    .brand-title { font-size: 26px; }
    .brand-subtitle { font-size: 14px; margin-bottom: 18px; }
    .brand-features { display: none; }
    .brand-footer { margin-top: 12px; }
    .auth-content { padding: 32px 20px; }
    .auth-card { padding: 32px 24px; }
    .auth-title { font-size: 22px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .brand-logo img { width: 48px; height: 48px; }
    .form-options { flex-direction: column; align-items: flex-start; }
}

/* Ajustes al notificador de Laravel ya existente */
.alert-default-success,
.alert-default-warning,
.alert-default-info,
.alert-default-danger {
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13.5px;
    border-left: 3px solid currentColor;
    margin-bottom: 18px;
}
