/* ============================================================
   MioPlus – Login Page Styles
   Version: 1  |  Increment ?v= in login.html when changed
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1a56db;
  --primary-dark: #1141a8;
  --primary-light: #eff6ff;
  --secondary: #be123c;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --dark: #0f172a;
  --dark2: #1e293b;
  --text: #334155;
  --text-light: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
}
body { font-family: 'Inter', sans-serif; min-height: 100vh; display: flex; background: var(--bg); overflow: hidden; }

/* LEFT PANEL */
.left-panel {
  flex: 1; min-height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 45%, #1a56db 80%, #0ea5e9 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem; position: relative; overflow: hidden;
}
.left-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.left-orb1 { position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(14,165,233,0.2) 0%, transparent 70%); top: -100px; right: -100px; }
.left-orb2 { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%); bottom: 50px; left: -50px; }

.left-logo { position: relative; z-index: 2; }
.left-logo img { height: 38px; filter: brightness(10); }

.left-hero { position: relative; z-index: 2; }
.left-hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #93c5fd; padding: 0.4rem 1rem; border-radius: 100px;
  font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem;
}
.left-hero h1 { font-size: 3rem; font-weight: 900; color: white; line-height: 1.1; margin-bottom: 1rem; }
.left-hero h1 span { background: linear-gradient(135deg,#f59e0b,#fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.left-hero p { color: rgba(255,255,255,0.65); font-size: 1rem; line-height: 1.7; max-width: 380px; }

.left-modules { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; position: relative; z-index: 2; margin-top: 2.5rem; }
.mod-chip {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.4rem;
  backdrop-filter: blur(10px); transition: all 0.2s;
}
.mod-chip:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.mod-chip i { font-size: 1.2rem; }
.mod-chip span { color: rgba(255,255,255,0.9); font-size: 0.78rem; font-weight: 600; }
.left-footer { position: relative; z-index: 2; color: rgba(255,255,255,0.4); font-size: 0.8rem; }

/* RIGHT PANEL */
.right-panel {
  width: 480px; min-height: 100vh;
  background: white; display: flex; align-items: center; justify-content: center;
  padding: 3rem 3.5rem;
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
  overflow-y: auto;
}
.login-form { width: 100%; }
.form-top-badge { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.form-badge-label { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.form-secure { display: flex; align-items: center; gap: 0.4rem; background: #f0fdf4; color: var(--success); font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 100px; border: 1px solid #bbf7d0; }
.form-title { font-size: 2rem; font-weight: 800; color: var(--dark); margin-bottom: 0.5rem; }
.form-subtitle { font-size: 0.9rem; color: var(--text-light); margin-bottom: 2.5rem; line-height: 1.5; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.form-input-wrap { position: relative; }
.form-input {
  width: 100%; padding: 0.875rem 1rem 0.875rem 2.8rem;
  border: 2px solid var(--border); border-radius: 12px;
  font-size: 0.95rem; font-family: 'Inter', sans-serif; color: var(--dark);
  background: var(--bg); transition: all 0.2s; outline: none;
}
.form-input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(26,86,219,0.08); }
.form-input::placeholder { color: #94a3b8; }
.input-icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.9rem; pointer-events: none; }
.input-icon.active { color: var(--primary); }
.input-suffix { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: #94a3b8; cursor: pointer; font-size: 0.9rem; transition: color 0.2s; }
.input-suffix:hover { color: var(--primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-options { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.checkbox-wrap { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-wrap input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.checkbox-wrap span { font-size: 0.85rem; color: var(--text); }
.forgot-link { font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: none; cursor: pointer; }
.forgot-link:hover { text-decoration: underline; }

.btn-login {
  width: 100%; padding: 1rem; background: var(--primary); color: white;
  border: none; border-radius: 12px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: 'Inter', sans-serif;
}
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,86,219,0.35); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-login .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-light); }
.form-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }

.divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; }

.error-msg { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.85rem; margin-bottom: 1rem; display: none; align-items: center; gap: 0.5rem; }
.error-msg.show { display: flex; }

/* MODAL OVERLAY */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal { background: white; border-radius: 24px; padding: 2.5rem; width: 90%; max-width: 500px; box-shadow: 0 40px 120px rgba(0,0,0,0.2); transform: scale(0.9) translateY(20px); transition: all 0.3s; max-height: 90vh; overflow-y: auto; }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.5rem; }
.modal-badge { font-size: 0.72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.modal-title { font-size: 1.6rem; font-weight: 800; color: var(--dark); }
.modal-desc { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; margin: 0.75rem 0 1.75rem; }
.modal-close { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; color: var(--text-light); transition: all 0.2s; flex-shrink: 0; font-weight: 700; }
.modal-close:hover { background: var(--border); color: var(--dark); }

/* MFA */
.channel-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.channel-option { border: 2px solid var(--border); border-radius: 14px; padding: 1.25rem; cursor: pointer; transition: all 0.2s; text-align: center; position: relative; }
.channel-option:hover { border-color: #93c5fd; background: var(--primary-light); }
.channel-option.selected { border-color: var(--primary); background: var(--primary-light); }
.channel-option .ch-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.channel-option .ch-name { font-size: 1rem; font-weight: 700; color: var(--dark); }
.channel-option .ch-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.2rem; }
.channel-badge { position: absolute; top: -8px; right: -8px; background: var(--success); color: white; font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 100px; }

.btn-modal-primary { width: 100%; padding: 0.95rem; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-modal-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,86,219,0.3); }
.btn-modal-cancel { display: block; text-align: center; margin-top: 1rem; color: var(--primary); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.btn-modal-cancel:hover { opacity: 0.7; }

.mfa-sent-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.mfa-sent-info .sent-label { font-size: 0.78rem; color: #166534; font-weight: 600; margin-bottom: 0.25rem; }
.mfa-sent-info .sent-target { font-size: 1rem; font-weight: 700; color: #15803d; }
.mfa-success-banner { background: #dcfce7; border: 1px solid #86efac; border-radius: 10px; padding: 0.75rem 1rem; color: #15803d; font-size: 0.88rem; font-weight: 600; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; display: none; }
.mfa-success-banner.show { display: flex; }

.timer-box { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 2px solid var(--border); border-radius: 12px; padding: 0.875rem 1rem; margin-bottom: 1.25rem; }
.timer-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.timer-value { font-size: 1.2rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.timer-value.warning { color: var(--warning); }
.timer-value.danger { color: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.otp-single { width: 100%; height: 58px; text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.5rem; border: 2px solid var(--border); border-radius: 14px; outline: none; font-family: 'Inter', sans-serif; color: var(--dark); background: var(--bg); transition: all 0.2s; caret-color: var(--primary); margin-bottom: 1.5rem; }
.otp-single:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(26,86,219,0.08); }
.otp-single.filled { border-color: var(--primary); background: var(--primary-light); }
.otp-resend { text-align: center; font-size: 0.85rem; color: var(--text-light); margin-top: 0.75rem; }
.otp-resend a { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none; }
.otp-resend a:hover { text-decoration: underline; }

.reset-step { display: none; }
.reset-step.active { display: block; }
.step-indicator { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.step-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background 0.3s; }
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--success); }

.select-input { width: 100%; padding: 0.875rem 1rem; border: 2px solid var(--border); border-radius: 12px; font-size: 0.95rem; font-family: 'Inter', sans-serif; color: var(--dark); background: var(--bg); transition: all 0.2s; outline: none; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.25rem; }
.select-input:focus { border-color: var(--primary); background-color: white; box-shadow: 0 0 0 4px rgba(26,86,219,0.08); }

.new-pass-rules { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; }
.rule { font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; color: var(--text-light); }
.rule.ok { color: var(--success); }
.rule i { font-size: 0.75rem; width: 14px; }

@media (max-width: 900px) { .left-panel { display: none; } .right-panel { width: 100%; box-shadow: none; } }
@media (max-width: 480px) { .right-panel { padding: 2rem 1.5rem; } .channel-options { grid-template-columns: 1fr; } }
