:root {
    --golem-orange: #E8941A;
    --golem-orange-hover: #D07A0E;
    --brick-red: #C8392B;
    --brick-red-dark: #A42D21;
    --dark-bg: #181B20;
    --dark-surface: #1E2228;
    --dark-border: rgba(255,255,255,0.07);
    --surface: #F0F2F5;
    --card: #FFFFFF;
    --text-primary: #1A1A2E;
    --text-secondary: #6C757D;
    --text-light: rgba(255,255,255,0.55);
    --border: #E4E7EC;
    --input-bg: #F8F9FB;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--dark-bg);
}

/* ── Layout ─────────────────────────────── */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Left Panel ──────────────────────────── */
.left-panel {
    width: 440px;
    flex-shrink: 0;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Subtle brick-grid texture */
.left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 34px,
            var(--dark-border) 34px,
            var(--dark-border) 35px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 69px,
            var(--dark-border) 69px,
            var(--dark-border) 70px
        );
    pointer-events: none;
}

/* Orange-to-red right edge accent */
.left-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--golem-orange), var(--brick-red));
    z-index: 2;
}

.left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 48px;
    position: relative;
    z-index: 1;
    gap: 52px;
}

/* Brand */
.brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-logo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-ladrillos {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

.brand-golem {
    font-size: 52px;
    font-weight: 900;
    color: var(--golem-orange);
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0 0 60px rgba(232,148,26,0.25);
}

.brand-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--golem-orange), var(--brick-red));
    border-radius: 99px;
    margin: 4px 0;
}

.brand-tagline {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    line-height: 1.5;
}

/* Processes */
.processes-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.processes-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
}

.processes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.process-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.process-card:hover {
    border-color: rgba(232,148,26,0.3);
    background: rgba(232,148,26,0.04);
}

.process-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-icon svg {
    width: 18px;
    height: 18px;
}

.process-icon.molienda   { background: rgba(232,148,26,0.15); color: var(--golem-orange); }
.process-icon.produccion { background: rgba(200,57,43,0.15);  color: var(--brick-red); }
.process-icon.secado     { background: rgba(232,148,26,0.12); color: #F5BC4A; }
.process-icon.horneado   { background: rgba(200,57,43,0.12);  color: #E05C40; }

.process-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.2px;
}

.process-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 2px;
}

/* Left footer */
.left-footer {
    padding: 24px 48px;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--dark-border);
}

.left-footer p {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

/* ── Right Panel ─────────────────────────── */
.right-panel {
    flex: 1;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    position: relative;
}

/* Subtle watermark */
.right-panel::before {
    content: 'GOLEM';
    position: absolute;
    bottom: -20px;
    right: -10px;
    font-size: 180px;
    font-weight: 900;
    color: rgba(0,0,0,0.025);
    letter-spacing: -5px;
    user-select: none;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 20px;
    padding: 48px 44px;
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 1;
}

/* Top accent bar */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 44px;
    right: 44px;
    height: 3px;
    background: linear-gradient(90deg, var(--golem-orange), var(--brick-red));
    border-radius: 0 0 3px 3px;
}

/* Card header */
.login-card-header {
    margin-bottom: 36px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--golem-orange), var(--brick-red));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 14px rgba(232,148,26,0.35);
}

.header-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.login-card-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.login-card-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Alert */
.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid var(--brick-red);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 24px;
}

.alert-error svg {
    width: 16px;
    height: 16px;
    color: var(--brick-red);
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error span {
    font-size: 13.5px;
    color: #B91C1C;
    line-height: 1.45;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 7px;
    letter-spacing: 0.1px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9CA3AF;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 16px;
    height: 16px;
}

.input-wrapper input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
    -webkit-appearance: none;
}

.input-wrapper input:focus {
    border-color: var(--golem-orange);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232,148,26,0.12);
}

.input-wrapper input::placeholder {
    color: #C1C7D0;
    font-weight: 400;
}

.input-wrapper input.is-invalid {
    border-color: var(--brick-red);
    background: #fff;
}

/* Password toggle */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-toggle-password:hover { color: var(--text-secondary); }

.btn-toggle-password svg {
    width: 16px;
    height: 16px;
}

/* Remember me */
.form-options {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--golem-orange);
    cursor: pointer;
}

.checkbox-wrapper span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Submit button */
.btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--golem-orange) 0%, var(--brick-red) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 14px rgba(200,57,43,0.25);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(200,57,43,0.35);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(200,57,43,0.2);
}

.btn-login svg {
    width: 18px;
    height: 18px;
    transition: transform 0.15s;
}

.btn-login:hover svg {
    transform: translateX(3px);
}

/* Footer */
.card-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.card-footer p {
    font-size: 12px;
    color: #C1C7D0;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 900px) {
    .left-panel { width: 360px; }
    .left-content { padding: 40px 36px; }
    .left-footer { padding: 20px 36px; }
}

@media (max-width: 700px) {
    .login-wrapper { flex-direction: column; }
    .left-panel { width: 100%; min-height: auto; }
    .left-content { padding: 28px 24px; gap: 20px; }
    .left-footer { display: none; }
    .right-panel { padding: 28px 16px; flex: none; }
    .right-panel::before { display: none; }
    .login-card { border-radius: var(--radius); padding: 28px 20px; }
    .brand img { width: 60px !important; height: 60px !important; }
}

@media (max-width: 480px) {
    .left-content { padding: 20px 16px; }
    .login-card { padding: 24px 16px; }
    .right-panel { padding: 16px; }
    .processes-section { display: none; }
    .brand img { width: 52px !important; height: 52px !important; }
}
