/* =========================================================
   CONTROL DE ASISTENCIA UMG
   main.css
   Base, variables, controles generales y login
   ========================================================= */


/* ---------------------------------------------------------
   VARIABLES
   --------------------------------------------------------- */

:root {
    color-scheme: light;

    --font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f1f5f9;
    --surface-strong: #eef2f7;

    --text: #172033;
    --text-soft: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-border: #bfdbfe;

    --cyan: #0891b2;
    --cyan-soft: #ecfeff;

    --purple: #7c3aed;
    --purple-soft: #f5f3ff;

    --success: #15803d;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;

    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --danger: #b91c1c;
    --danger-hover: #991b1b;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --neutral-bg: #f1f5f9;
    --neutral-border: #dbe3ec;
    --neutral-text: #475569;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 1px 4px rgba(15, 23, 42, 0.03);

    --shadow-md:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --shadow-lg:
        0 22px 55px rgba(15, 23, 42, 0.16);

    --radius-sm: 7px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --transition: 160ms ease;

    --sidebar-bg: #0f1c36;
    --sidebar-bg-hover: #182846;
    --sidebar-text: #dbe5f5;
    --sidebar-muted: #8494ad;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active: #2563eb;
}


/* ---------------------------------------------------------
   DARK
   --------------------------------------------------------- */

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #101623;
    --surface: #182131;
    --surface-soft: #1c2738;
    --surface-hover: #243247;
    --surface-strong: #263449;

    --text: #edf3fb;
    --text-soft: #aab8cd;
    --text-muted: #7988a0;

    --border: #2b394d;
    --border-strong: #3a4b63;

    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-soft: rgba(59, 130, 246, 0.12);
    --primary-border: rgba(96, 165, 250, 0.28);

    --cyan: #22d3ee;
    --cyan-soft: rgba(34, 211, 238, 0.1);

    --purple: #a78bfa;
    --purple-soft: rgba(167, 139, 250, 0.1);

    --success: #4ade80;
    --success-bg: rgba(34, 197, 94, 0.11);
    --success-border: rgba(74, 222, 128, 0.24);

    --warning: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(251, 191, 36, 0.25);

    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(248, 113, 113, 0.25);

    --neutral-bg: #253247;
    --neutral-border: #35455d;
    --neutral-text: #c1ccdc;

    --shadow-sm:
        0 1px 3px rgba(0, 0, 0, 0.15);

    --shadow-md:
        0 12px 32px rgba(0, 0, 0, 0.22);

    --shadow-lg:
        0 24px 60px rgba(0, 0, 0, 0.34);

    --sidebar-bg: #0b1220;
    --sidebar-bg-hover: #152035;
}


/* ---------------------------------------------------------
   RESET
   --------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

form {
    margin: 0;
}

button {
    border: 0;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

[hidden] {
    display: none !important;
}


/* ---------------------------------------------------------
   TEXT
   --------------------------------------------------------- */

.eyebrow {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.text-muted {
    color: var(--text-muted);
}

.primary-value {
    color: var(--text);
    font-weight: 700;
}

.table-note {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 12px;
}

.text-link {
    color: var(--primary);
    font-weight: 600;
    word-break: break-word;
}

.text-link:hover {
    text-decoration: underline;
}

.text-link-secondary {
    color: var(--text-soft);
}


/* ---------------------------------------------------------
   BUTTONS
   --------------------------------------------------------- */

.button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 680;
    line-height: 1;
    white-space: nowrap;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.button:hover {
    text-decoration: none;
}

.button:active {
    transform: translateY(1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.menu-toggle:focus-visible,
.theme-toggle:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

.button-primary {
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
}

.button-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

html[data-theme="dark"] .button-primary {
    color: #ffffff;
    background: #2563eb;
    border-color: #3b82f6;
}

html[data-theme="dark"] .button-primary:hover {
    background: #1d4ed8;
}

.button-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.button-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.button-danger {
    color: var(--danger);
    background: var(--surface);
    border-color: var(--danger-border);
}

.button-danger:hover {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.button-quiet {
    min-height: 34px;
    color: var(--text-soft);
    background: transparent;
    border-color: transparent;
}

.button-quiet:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.button-compact {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.button-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    background: transparent;
    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.icon-button:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}

.icon-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ---------------------------------------------------------
   INPUTS
   --------------------------------------------------------- */

.input-control,
.select-control,
.textarea-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.input-control,
.select-control {
    min-height: 40px;
    padding: 8px 11px;
}

.textarea-control {
    min-height: 90px;
    padding: 10px 11px;
    line-height: 1.5;
    resize: vertical;
}

.input-control::placeholder,
.textarea-control::placeholder {
    color: var(--text-muted);
}

.input-control:hover,
.select-control:hover,
.textarea-control:hover {
    border-color: var(--border-strong);
}

.input-control:focus,
.select-control:focus,
.textarea-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-control:disabled,
.select-control:disabled,
.textarea-control:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    background: var(--surface-soft);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-control {
    border-radius:
        var(--radius-sm)
        0
        0
        var(--radius-sm);
}

.input-addon {
    min-width: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius:
        0
        var(--radius-sm)
        var(--radius-sm)
        0;
    color: var(--text-soft);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   FORM FIELD
   --------------------------------------------------------- */

.form-field {
    min-width: 0;
}

.form-field label,
.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.4;
}

.required-mark {
    color: var(--danger);
}


/* ---------------------------------------------------------
   BADGES
   --------------------------------------------------------- */

.status-badge,
.role-badge,
.result-badge {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.status-success,
.result-success {
    color: var(--success);
    background: var(--success-bg);
    border-color: var(--success-border);
}

.status-warning,
.result-warning {
    color: var(--warning);
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.status-danger {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.status-neutral,
.result-neutral,
.role-badge {
    color: var(--neutral-text);
    background: var(--neutral-bg);
    border-color: var(--neutral-border);
}


/* ---------------------------------------------------------
   ALERTS
   --------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--radius);
}

.alert-danger {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.alert-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alert-copy {
    min-width: 0;
}

.alert-copy strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.alert-copy p {
    margin: 0;
    color: currentColor;
    font-size: 13px;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;
    background: var(--bg);
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns:
        minmax(360px, 0.9fr)
        minmax(420px, 1.1fr);
}

.login-brand-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            #0b1731 0%,
            #10264d 55%,
            #173868 100%
        );
}

.login-brand-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(56, 189, 248, 0.14),
            transparent 32%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(124, 58, 237, 0.14),
            transparent 35%
        );
}

.login-brand-content {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 7vw, 90px);
}

.login-brand-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 46px;
}

.login-brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.login-brand-copy strong {
    display: block;
    font-size: 20px;
}

.login-brand-copy span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
}

.login-brand-message {
    max-width: 520px;
    margin-bottom: 36px;
}

.login-brand-message h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.login-brand-message p {
    max-width: 460px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 15px;
    line-height: 1.7;
}

.login-brand-features {
    display: grid;
    gap: 12px;
}

.login-brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.login-brand-feature svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-access-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px;
    background: var(--surface);
}

.login-access-inner {
    width: min(100%, 420px);
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    margin-bottom: 7px;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.login-header p {
    margin: 0;
    color: var(--text-soft);
}

.login-alert {
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 650;
}

.login-input-control {
    position: relative;
}

.login-input-control > svg,
.login-input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-input-control input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px 9px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
    outline: none;
}

.login-input-control input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-password-control {
    position: relative;
}

.login-password-control input {
    padding-left: 46px;
    padding-right: 46px;
}

.login-password-control input[type="password"]::-ms-reveal,
.login-password-control input[type="password"]::-ms-clear {
    display: none;
}

.login-password-control button {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border-radius: 7px;
    color: var(--text-soft);
    background: transparent;
}

.login-password-control button:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.login-password-control button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.login-submit {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius);
    color: #ffffff;
    background: #2563eb;
    font-weight: 700;
}

.login-submit:hover {
    background: #1d4ed8;
}

.login-footer {
    margin-top: 26px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}


/* ---------------------------------------------------------
   LOGIN RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: auto;
    }

    .login-brand-content {
        min-height: auto;
        padding: 34px 28px;
    }

    .login-brand-identity {
        margin-bottom: 22px;
    }

    .login-brand-message {
        margin-bottom: 0;
    }

    .login-brand-message h1 {
        font-size: 30px;
    }

    .login-brand-features {
        display: none;
    }

    .login-access-panel {
        min-height: auto;
        padding: 40px 24px;
    }

}


@media (max-width: 520px) {

    .login-brand-panel {
        display: none;
    }

    .login-access-panel {
        min-height: 100vh;
        padding: 28px 20px;
    }

}
