/* ==========================================================================
   ETNA D.O.O. - LOGIN STILOVI (GLASSMORPHISM & PREMIUM DARK ACCENTS)
   ========================================================================== */

:root {
  --bg-dark: #0c0c0e;
  --bg-card: rgba(18, 18, 22, 0.65);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-focus: #e74c3c;
  
  --primary: #e74c3c;
  --primary-hover: #c0392b;
  --text-main: #f5f6fa;
  --text-muted: #8f92a1;
  --error: #ea8685;
  --error-bg: rgba(234, 134, 133, 0.1);
  --error-border: rgba(234, 134, 133, 0.2);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ==========================================
   1. DIZAJN POZADINE (GLOWS & GRIDS)
   ========================================== */

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: screen;
}

.bg-glow-1 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(231, 76, 60, 0.35) 0%, rgba(0, 0, 0, 0) 70%);
  top: -15%;
  left: -10%;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.bg-glow-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: -20%;
  right: -10%;
  animation: floatGlow 20s infinite alternate-reverse ease-in-out;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 2;
  pointer-events: none;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4%, 5%) scale(1.15); }
}

/* ==========================================
   2. LOGIN CONATINER & CARD
   ========================================== */

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  z-index: 10;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  transition: var(--transition-smooth);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.5), transparent);
}

/* LOGO */
.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-text h1 span {
  color: var(--primary);
  font-weight: 400;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* INTRO TEXT */
.card-intro h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.card-intro p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ==========================================
   3. FORM ELEMENTS (INPUTS & FIELDSETS)
   ========================================== */

#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px 14px 44px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-wrapper input:focus {
  border-color: rgba(231, 76, 60, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 
    0 0 12px rgba(231, 76, 60, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.input-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus ~ .input-icon {
  color: var(--primary);
}

.btn-toggle-pwd {
  position: absolute;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  outline: none;
  padding: 4px;
  transition: var(--transition-smooth);
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

/* ==========================================
   4. ERROR BOX
   ========================================== */

.error-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: fadeIn 0.3s ease;
}

.error-icon {
  font-size: 16px;
}

.error-msg {
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
  line-height: 1.4;
}

.hide {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   5. BUTTON & SPINNER
   ========================================== */

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(231, 76, 60, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

/* SPINNER */
.loader-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* SHAKE ANIMATION ON ERROR */
.shake {
  animation: shakeEffect 0.5s ease-in-out;
}

@keyframes shakeEffect {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ==========================================
   6. FOOTER & MEDIA QUERIES
   ========================================== */

.card-footer {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 20px;
}

.card-footer p {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    gap: 24px;
  }
  
  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .brand-text h1 {
    font-size: 19px;
  }
}

/* PORTAL SWITCH LINK STYLES */
.portal-switch-container {
  text-align: center;
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.portal-switch-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  margin-left: 5px;
  transition: var(--transition-smooth);
  position: relative;
  display: inline-block;
}

.portal-switch-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.portal-switch-link:hover {
  color: var(--primary-hover);
}

.portal-switch-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
