﻿/* ═══════════════════════════════════════════════════════════════
   KTU Connect  –  Login Theme
   Koforidua Technical University  |  Management Information System
   Colours sourced from ktu.edu.gh
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* KTU brand colours extracted from ktu.edu.gh */
  --ktu-navy:        #012169;   /* primary dark navy              */
  --ktu-navy-dark:   #010E3A;   /* deepest background shade       */
  --ktu-navy-mid:    #2F5EA8;   /* medium blue (hover / accents)  */
  --ktu-navy-alt:    #223E65;   /* alternate dark blue            */
  --ktu-navy-light:  #E6ECF5;   /* tint for mobile badge bg       */
  --ktu-gold:        #fcb900;   /* KTU gold                       */
  --ktu-gold-light:  #FFD75E;   /* lighter gold for dark panels   */
  --ktu-gold-pale:   #FFF8E1;   /* very light gold tint           */
  --ktu-white:       #ffffff;
  --ktu-bg:          #f0f4f9;
  --ktu-border:      #d1d9e6;
  --ktu-text:        #1e293b;
  --ktu-muted:       #64748b;
  --ktu-radius-sm:   8px;
  --ktu-radius-md:   14px;
  --ktu-radius-lg:   20px;
  --ktu-shadow:      0 24px 64px rgba(1, 33, 105, 0.14);
  --ktu-transition:  0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: var(--ktu-text);
  background: var(--ktu-navy-dark);
}

/* ── Split Shell ────────────────────────────────────────────────── */
.ktu-split-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ════════════════════════════════════════════════════════════════
   LEFT PANEL  –  Branding
   ════════════════════════════════════════════════════════════════ */
.ktu-panel-left {
  position: relative;
  width: 46%;
  min-height: 100vh;
  /* KTU navy gradient over the background image */
  background:
    linear-gradient(155deg,
      rgba(1,  14,  58, 0.55)  0%,
      rgba(1,  33, 105, 0.48) 45%,
      rgba(47, 94, 168, 0.42) 75%,
      rgba(1,  14,  58, 0.58) 100%),
    url('../img/login-bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  padding: 3rem 3rem 2rem;
  overflow: hidden;
}

/* ── Decorative rings ───────────────────────────────────────────── */
.ktu-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.ktu-deco-1 {
  width: 460px; height: 460px;
  border: 65px solid rgba(252, 185, 0, 0.10);
  bottom: -140px; right: -140px;
}
.ktu-deco-2 {
  width: 260px; height: 260px;
  border: 40px solid rgba(252, 185, 0, 0.07);
  bottom: 10px; right: 70px;
}
.ktu-deco-3 {
  width: 180px; height: 180px;
  background: rgba(252, 185, 0, 0.05);
  top: -60px; left: -60px;
}

/* ── Left inner ─────────────────────────────────────────────────── */
.ktu-left-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* ── Emblem / Logo ──────────────────────────────────────────────── */
/* Left panel has no logo (transparent PNG needs white bg).
   Logo lives exclusively in the right white panel.             */

/* Desktop: compact logo above the Sign In heading */
.ktu-desktop-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
}
.ktu-desktop-logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

/* Mobile branding block: logo + full university name.
   Hidden on desktop, shown on mobile (see responsive section). */
.ktu-mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--ktu-border);
}
.ktu-mobile-logo-img {
  height: 100px;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}
.ktu-mobile-app-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--ktu-navy-light);
  border: 1px solid rgba(1, 33, 105, 0.18);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ktu-navy);
  margin-bottom: 0.6rem;
}
.ktu-mobile-uni-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ktu-navy);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.ktu-mobile-gold-bar {
  width: 40px; height: 3px;
  background: linear-gradient(90deg, var(--ktu-gold), transparent);
  border-radius: 2px;
  margin: 0 auto 0.5rem;
}
.ktu-mobile-mis {
  font-size: 0.8rem;
  color: var(--ktu-muted);
  letter-spacing: 0.03em;
}

/* ── Brand copy ─────────────────────────────────────────────────── */
.ktu-app-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: rgba(252, 185, 0, 0.15);
  border: 1px solid rgba(252, 185, 0, 0.40);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ktu-gold-light);
  margin-bottom: 0.75rem;
}

.ktu-uni-name {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ktu-white);
  margin-bottom: 1rem;
}

.ktu-gold-bar {
  width: 52px; height: 3px;
  background: linear-gradient(90deg, var(--ktu-gold), transparent);
  border-radius: 2px;
  margin-bottom: 0.85rem;
}

.ktu-mis-label {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
}

/* ── Tagline ────────────────────────────────────────────────────── */
.ktu-tagline {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--ktu-gold);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 var(--ktu-radius-sm) var(--ktu-radius-sm) 0;
  font-style: italic;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.55;
}

/* ── Feature pills ──────────────────────────────────────────────── */
.ktu-pills { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.ktu-pill {
  padding: 0.3rem 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.70);
  white-space: nowrap;
}

/* ── Left footer ────────────────────────────────────────────────── */
.ktu-left-footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.30);
}

/* ════════════════════════════════════════════════════════════════
   RIGHT PANEL  –  Login Form
   ════════════════════════════════════════════════════════════════ */
.ktu-panel-right {
  flex: 1;
  background: var(--ktu-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  min-height: 100vh;
}

/* ── Card ───────────────────────────────────────────────────────── */
.ktu-form-card {
  background: var(--ktu-white);
  border-radius: var(--ktu-radius-lg);
  box-shadow: var(--ktu-shadow);
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 430px;
}

/* ── Desktop logo (hidden on mobile) ───────────────────────────── */
.ktu-desktop-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
}
.ktu-desktop-logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

/* ── Mobile branding (hidden on desktop) ────────────────────────── */
.ktu-mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--ktu-border);
}
.ktu-mobile-logo-img {
  height: 100px;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}
.ktu-mobile-app-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--ktu-navy-light);
  border: 1px solid rgba(1, 33, 105, 0.18);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ktu-navy);
  margin-bottom: 0.6rem;
}
.ktu-mobile-uni-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ktu-navy);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.ktu-mobile-gold-bar {
  width: 40px; height: 3px;
  background: linear-gradient(90deg, var(--ktu-gold), transparent);
  border-radius: 2px;
  margin: 0 auto 0.5rem;
}
.ktu-mobile-mis {
  font-size: 0.8rem;
  color: var(--ktu-muted);
  letter-spacing: 0.03em;
}

/* ── Form heading ───────────────────────────────────────────────── */
.ktu-form-heading { margin-bottom: 1.75rem; }

.ktu-form-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ktu-navy);
  margin-bottom: 0.35rem;
}

.ktu-form-sub {
  font-size: 0.875rem;
  color: var(--ktu-muted);
}

/* ── Client target indicator ────────────────────────────────────── */
.ktu-client-target {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding: 0.3rem 0.75rem;
  background: var(--ktu-navy-light);
  border: 1px solid var(--ktu-border);
  border-radius: var(--ktu-radius-sm);
  font-size: 0.8rem;
}
.ktu-client-arrow {
  color: var(--ktu-navy-mid);
  font-size: 1rem;
  line-height: 1;
}
.ktu-client-name {
  font-weight: 600;
  color: var(--ktu-navy);
}
.ktu-client-desc {
  color: var(--ktu-muted);
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.ktu-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--ktu-radius-sm);
  border: 1px solid;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.ktu-alert-icon { font-weight: 700; flex-shrink: 0; font-size: 0.95rem; }
.ktu-alert-error   { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.ktu-alert-success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.ktu-alert-warning { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.ktu-alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }

/* ════════════════════════════════════════════════════════════════
   PF5 OVERRIDES  –  restyle Keycloak's form elements
   ════════════════════════════════════════════════════════════════ */

#kc-header, #kc-header-wrapper { display: none !important; }

.pf-v5-c-login,
.pf-v5-c-login__container { all: unset; display: contents; }

/* Labels */
.ktu-panel-right .pf-v5-c-form__label,
.ktu-panel-right .pf-v5-c-form__label-text {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--ktu-text) !important;
}

/* Inputs */
.ktu-panel-right .pf-v5-c-form-control,
.ktu-panel-right input[type="text"],
.ktu-panel-right input[type="email"],
.ktu-panel-right input[type="password"] {
  width: 100% !important;
  border: 1.5px solid var(--ktu-border) !important;
  border-radius: var(--ktu-radius-sm) !important;
  padding: 0.7rem 1rem !important;
  font-size: 0.95rem !important;
  color: var(--ktu-text) !important;
  background: var(--ktu-white) !important;
  box-shadow: none !important;
  outline: none;
  transition: border-color var(--ktu-transition), box-shadow var(--ktu-transition);
}
.ktu-panel-right .pf-v5-c-form-control:focus,
.ktu-panel-right input[type="text"]:focus,
.ktu-panel-right input[type="email"]:focus,
.ktu-panel-right input[type="password"]:focus {
  border-color: var(--ktu-navy) !important;
  box-shadow: 0 0 0 3px rgba(1, 33, 105, 0.13) !important;
}

/* Primary button */
.ktu-panel-right .pf-v5-c-button.pf-m-primary,
.ktu-panel-right input[type="submit"],
.ktu-panel-right #kc-login {
  display: block !important;
  width: 100% !important;
  padding: 0.8rem 1rem !important;
  background: var(--ktu-navy) !important;
  color: var(--ktu-white) !important;
  border: none !important;
  border-radius: var(--ktu-radius-sm) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
  transition: background var(--ktu-transition), transform var(--ktu-transition), box-shadow var(--ktu-transition);
}
.ktu-panel-right .pf-v5-c-button.pf-m-primary:hover,
.ktu-panel-right input[type="submit"]:hover {
  background: var(--ktu-navy-mid) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(1, 33, 105, 0.28) !important;
}
.ktu-panel-right .pf-v5-c-button.pf-m-primary:active,
.ktu-panel-right input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none !important;
}

/* Links */
.ktu-panel-right .pf-v5-c-button.pf-m-link,
.ktu-panel-right a {
  color: var(--ktu-navy) !important;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--ktu-transition);
}
.ktu-panel-right .pf-v5-c-button.pf-m-link:hover,
.ktu-panel-right a:hover { color: var(--ktu-gold) !important; }

/* Checkbox */
.ktu-panel-right input[type="checkbox"] { accent-color: var(--ktu-navy); }

/* Form group spacing */
.ktu-panel-right .pf-v5-c-form__group { margin-bottom: 1.1rem !important; }

/* Remember-me row */
.ktu-panel-right #kc-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* Forgot-password */
.ktu-panel-right #kc-form-options a {
  font-size: 0.85rem;
  color: var(--ktu-navy) !important;
}

.ktu-form-body { margin-bottom: 0.25rem; }

/* Social providers */
.ktu-social-section { margin-top: 1.25rem; }

.ktu-social-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--ktu-muted);
  margin-bottom: 0.85rem;
}
.ktu-social-divider::before,
.ktu-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ktu-border);
}

/* Info block */
.ktu-form-info {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ktu-border);
  font-size: 0.875rem;
  color: var(--ktu-muted);
  text-align: center;
  line-height: 1.6;
}
.ktu-form-info a { color: var(--ktu-navy) !important; font-weight: 600; }
.ktu-form-info a:hover { color: var(--ktu-gold) !important; }

/* Right footer */
.ktu-right-footer {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--ktu-muted);
  text-align: center;
}
.ktu-right-footer a { color: var(--ktu-navy); font-weight: 500; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   Desktop ≥ 960px : split screen (left branding + right form)
   Mobile  < 960px : single column (logo/brand on white + form)
   ════════════════════════════════════════════════════════════════ */

@media (min-width: 960px) {
  .ktu-mobile-brand { display: none !important; }
}

@media (max-width: 959px) {
  .ktu-split-screen { flex-direction: column; background: var(--ktu-bg); }
  .ktu-panel-left   { display: none; }

  .ktu-panel-right {
    flex: unset;
    width: 100%;
    min-height: 100vh;
    padding: 2.5rem 1.25rem 2rem;
    justify-content: flex-start;
  }

  .ktu-form-card {
    max-width: 480px;
    margin: 0 auto;
    border-radius: var(--ktu-radius-md);
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(1, 33, 105, 0.10);
  }

  .ktu-desktop-logo { display: none !important; }
  .ktu-mobile-brand { display: flex !important; }

  .ktu-form-title   { font-size: 1.35rem; }
  .ktu-form-sub     { font-size: 0.82rem; }
  .ktu-right-footer { margin-top: 1.25rem; }
}

@media (max-width: 480px) {
  .ktu-panel-right      { padding: 1.5rem 0.75rem; }
  .ktu-form-card        { border-radius: var(--ktu-radius-sm); padding: 1.75rem 1.1rem; }
  .ktu-mobile-logo-img  { height: 80px; }
  .ktu-mobile-uni-name  { font-size: 1.05rem; }
  .ktu-form-title       { font-size: 1.2rem; }
}

/* end of custom.css */

