/* Variables */
:root {
  --brand: #dc2626;
  --brand-dark: #b82c2c;
  --bg: #f5f5f5;
  --black: #000;
  --input-border: #000;
  --radius: 10px;
  --max-width: 1400px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Layout */
.container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 8vw, 120px);
  max-width: var(--max-width);
  width: 95%;
  height: 90vh;
  max-height: 900px;
  margin: 0 auto;
}

/* Logo section */
.logo-section {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 50%;
}

.logo-text {
  font-size: clamp(40px, 7vw, 110px);
  font-weight: bold;
  font-style: italic;
  color: var(--brand);
  margin-bottom: clamp(8px, 1vh, 15px);
  line-height: 1;
}

.subtitle {
  font-size: clamp(16px, 2vw, 28px);
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--black);
}

/* Responsive images */
.logo-section img,
.card-logo img {
  max-width: 100%;
  max-height: 40vh;
  height: auto;
  width: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Login card */
.login-card {
  background: #fff;
  border: 2px solid var(--black);
  border-radius: 12px;
  padding: clamp(28px, 4vh, 64px) clamp(30px, 5vw, 64px);
  width: clamp(280px, 40%, 500px);
  max-width: 500px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 85vh;
  overflow-y: auto;
}

/* Card header */
.card-logo {
  text-align: center;
  margin-bottom: clamp(15px, 2.5vh, 30px);
}

.card-logo-text {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: bold;
  font-style: italic;
  color: var(--brand);
  line-height: 1;
}

.card-subtitle {
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--black);
}

.welcome-text {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  text-align: center;
  margin-bottom: clamp(15px, 2.5vh, 30px);
  color: var(--black);
}

/* Form */
.form-group {
  margin-bottom: clamp(15px, 2.5vh, 25px);
}

.form-group:last-of-type {
  margin-bottom: clamp(20px, 3vh, 35px);
}

.form-input {
  width: 100%;
  padding: clamp(12px, 1.5vh, 18px) clamp(14px, 2vw, 22px);
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font-size: clamp(15px, 1.6vw, 19px);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  color: #333;
}

.form-input:focus {
  border-color: var(--brand);
  box-shadow: none;
  outline: none;
}

/* Password wrapper & toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: clamp(48px, 6vw, 72px);
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(18px, 2vw, 24px);
  cursor: pointer;
  color: #666;
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(34px, 5vw, 44px);
  height: clamp(34px, 5vw, 44px);
  line-height: 1;
  border-radius: 6px;
}

.toggle-password:hover {
  color: var(--brand);
}

/* SVG sizing inside the toggle button */
.toggle-password svg {
  display: block;
  width: 1em;
  height: 1em;
}
/* Button */
.login-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: clamp(14px, 1.8vh, 18px) 0;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: bold;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-btn:hover {
  background: var(--brand-dark);
}

.login-btn:active {
  background: #B42525 !important;
}

.login-btn:focus {
  outline: none;
}

/* Errors & links */
.form-error {
  color: var(--brand);
  margin-top: 8px;
  font-size: clamp(12px, 1.4vw, 15px);
}

.forgot-password {
  text-align: center;
  margin-top: clamp(12px, 1.5vh, 18px);
}

.forgot-password a {
  color: var(--brand);
  text-decoration: none;
  font-size: clamp(13px, 1.4vw, 16px);
}

.forgot-password a:hover {
  text-decoration: underline;
}

/* Tablet and below - stack vertically */
@media (max-width: 968px) {
  .container {
    flex-direction: column;
    gap: clamp(20px, 4vh, 40px);
    height: 95vh;
    width: 90%;
  }

  .logo-section {
    max-width: 100%;
    flex: 0 1 auto;
  }

  .logo-section img {
    max-height: 25vh;
  }

  .login-card {
    width: 100%;
    max-width: 450px;
    flex: 0 1 auto;
  }
}

/* Mobile portrait - prioritize form */
@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .container {
    width: 100%;
    height: 100vh;
    gap: clamp(15px, 3vh, 25px);
  }

  .logo-section {
    flex: 0 0 auto;
  }

  .logo-text {
    font-size: clamp(32px, 10vw, 50px);
  }

  .logo-section img {
    max-height: 15vh;
  }

  .login-card {
    width: 90%;
    max-width: 100%;
    padding: clamp(22px, 3.5vh, 36px) clamp(22px, 5vw, 40px);
    border-width: 1px;
  }
}

/* Very small screens */
@media (max-height: 600px) {
  .container {
    height: 98vh;
  }

  .logo-section {
    display: none;
  }

  .login-card {
    max-height: 95vh;
    width: 95%;
    max-width: 500px;
  }

  .card-logo {
    margin-bottom: 15px;
  }

  .welcome-text {
    margin-bottom: 15px;
  }

  .form-group {
    margin-bottom: 12px;
  }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }
}

/* Landscape mobile */
@media (max-width: 968px) and (max-height: 500px) {
  .container {
    flex-direction: row;
    gap: 30px;
  }

  .logo-section {
    flex: 0 0 auto;
    max-width: 35%;
  }

  .logo-section img {
    max-height: 50vh;
  }

  .login-card {
    width: 55%;
    max-height: 90vh;
  }
}