/**
 * CTS GIS FTTH - Admin Sales Login Styles
 * Modern glassmorphism design with floating labels
 * @version 1.0
 * @date 2025-10-19
 */

/* ========================================
   Custom Fonts
   ======================================== */
@font-face {
  font-family: 'Sansation';
  src: url('../fonts/Sansation-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Sansation';
  src: url('../fonts/Sansation-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Sansation';
  src: url('../fonts/Sansation-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ========================================
   CSS Variables / Theme
   ======================================== */
:root {
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #ffffff 70%);
  --accent: #2563eb;
  --accent-grad: linear-gradient(90deg, #2563eb, #3b82f6);
  --accent-focus: 0 0 0 .15rem rgba(37, 99, 235, .35);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-base: #1e293b;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
}

/* ========================================
   Global Reset
   ======================================== */
* {
  box-sizing: border-box;
}

/* ========================================
   Body & Layout
   ======================================== */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: 'Sansation', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
  color: var(--text-base);
}

body:before,
body:after {
  display: none;
}

/* ========================================
   Login Wrapper
   ======================================== */
.login-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px 18px;
  position: relative;
  z-index: 2;
}

/* ========================================
   Glass Card Effect
   ======================================== */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .10);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease-out;
}

.glass-card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, .55),
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, .4) 70%,
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}

@keyframes cardIn {
  0% {
    transform: translateY(22px) scale(.97);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ========================================
   Brand Header
   ======================================== */
.brand-header {
  text-align: center;
  padding-top: 4px;
  padding-bottom: 4px;
}

.brand-logo {
  width: 180px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  background: transparent;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  padding: 0;
}

.brand-logo .logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.brand-title {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: #1e293b;
}

.brand-sub {
  font-size: .55rem;
  letter-spacing: 1.6px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ========================================
   Form Area
   ======================================== */
.form-area {
  padding: 2px 2px 0;
}

/* ========================================
   Floating Label Input Group
   ======================================== */
.floating-group {
  position: relative;
  margin-bottom: 14px;
}

.floating-group input {
  width: 100%;
  display: block;
  height: 44px;
  border-radius: 10px;
  padding: 14px 12px 0 46px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: .78rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.floating-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--accent-focus);
  background: #fff;
}

.floating-group label {
  position: absolute;
  left: 46px;
  top: 15px;
  font-size: .7rem;
  letter-spacing: .3px;
  color: var(--text-dim);
  font-weight: 500;
  transition: all .16s ease;
  pointer-events: none;
}

.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label {
  top: 7px;
  font-size: .52rem;
  letter-spacing: .45px;
  font-weight: 600;
  color: var(--accent);
}

/* ========================================
   Input Icon
   ======================================== */
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s ease;
}

.input-icon:hover {
  color: var(--accent);
}

/* ========================================
   Alert / Error Message
   ======================================== */
.alert-custom {
  border-radius: 10px;
  font-size: .66rem;
  font-weight: 500;
  padding: 6px 10px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  margin-bottom: 1rem;
}

/* ========================================
   Login Button
   ======================================== */
.login-btn {
  height: 44px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .25px;
  font-size: .8rem;
  background: var(--accent-grad);
  border: 1px solid #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(37, 99, 235, .4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.login-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, .5);
}

.login-btn:active {
  filter: brightness(.97);
  transform: translateY(0);
}

/* ========================================
   Remember Me Checkbox
   ======================================== */
.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 10px;
  font-size: .55rem;
  font-weight: 500;
  letter-spacing: .35px;
  color: var(--text-dim);
}

.remember-me input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.remember-me label {
  cursor: pointer;
  user-select: none;
}

/* ========================================
   Extra Links (Register, Forgot Password)
   ======================================== */
.extra-links {
  text-align: center;
  margin-top: 8px;
  font-size: .63rem;
  font-weight: 500;
  color: var(--text-dim);
}

.extra-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.extra-links a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* ========================================
   Small Note / Copyright
   ======================================== */
.small-note {
  font-size: .5rem;
  color: #94a3b8;
  margin-top: 14px;
  letter-spacing: .5px;
  text-align: center;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 10px 12px 16px;
  }
  
  .glass-card {
    border-radius: 12px;
  }
  
  .brand-title {
    font-size: .9rem;
  }
  
  .brand-logo {
    width: 140px;
    font-size: 17px;
    padding: 0;
    margin-bottom: 6px;
  }
  
  .brand-logo .logo-img {
    border-radius: 3px;
    height: auto;
  }
}

/* ========================================
   Loading State (Optional)
   ======================================== */
.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.login-btn.loading {
  position: relative;
  color: transparent;
}

.login-btn.loading:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

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

/* ========================================
   Accessibility
   ======================================== */
.floating-group input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  body {
    background: white;
  }
  
  .glass-card {
    box-shadow: none;
    border: 1px solid #000;
  }
}
