/* Custom Portal CSS for Crafty Controller Login (Clean Form Style) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #050811;
  --bg-card: rgba(10, 16, 30, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --color-green: #00f5a0;
  --color-blue: #00b3ff;
  --color-neon-blue: #00f2fe;
  --font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(rgba(5, 8, 17, 0.75), rgba(5, 8, 17, 0.9)), 
              url("../images/auth/login_bg.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: var(--font-family);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

@media (max-height: 720px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
}

/* Centered Container */
.portal-centered-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-header {
  margin-bottom: 16px;
  text-align: center;
}

.portal-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ==========================================================================
   Login Card
   ========================================================================== */
.portal-login-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 
              0 0 50px rgba(0, 245, 160, 0.03);
  backdrop-filter: blur(16px);
  padding: 24px 30px;
  position: relative;
  overflow: hidden;
}

.portal-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-green), var(--color-blue));
}

.card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.logo-glow-container {
  position: relative;
}

.logo-cube {
  filter: drop-shadow(0 0 8px rgba(0, 179, 255, 0.4));
  animation: cube-float 4s ease-in-out infinite;
}

@keyframes cube-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.25) 0%, rgba(0, 242, 254, 0) 70%);
  z-index: -1;
  filter: blur(5px);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

/* Custom Input Groups */
.form-group-custom {
  margin-bottom: 14px;
  position: relative;
}

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

.input-icon-custom {
  position: absolute;
  left: 16px;
  font-size: 1.25rem;
  color: #475569;
  pointer-events: none;
  transition: color var(--transition-speed) ease;
}

.input-field-custom {
  width: 100%;
  background: #090f1d;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px 12px 48px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-family);
  transition: all var(--transition-speed) ease;
}

.input-field-custom:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.input-field-custom:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 15px rgba(0, 245, 160, 0.15);
  background: #0c1527;
}

.input-field-custom:focus + .input-icon-custom {
  color: var(--color-green);
}

.toggle-password-custom {
  position: absolute;
  right: 16px;
  font-size: 1.2rem;
  color: #475569;
  cursor: pointer;
  transition: color 0.2s ease;
}

.toggle-password-custom:hover {
  color: var(--text-primary);
}

/* 2FA styling */
.label-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.badge-2fa {
  background: rgba(0, 179, 255, 0.15);
  color: var(--color-blue);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid rgba(0, 179, 255, 0.3);
}

.flex-container-custom {
  display: flex;
  gap: 10px;
}

.flex-container-custom > div {
  flex-grow: 1;
}

.select-custom-2fa {
  background: #090f1d;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0 12px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 130px;
}

.select-custom-2fa:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 10px rgba(0, 179, 255, 0.15);
}

/* Options */
.form-options-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.remember-me-custom {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  position: relative;
  padding-left: 24px;
}

.remember-me-custom input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark-custom {
  position: absolute;
  left: 0;
  height: 16px;
  width: 16px;
  background-color: #090f1d;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  transition: all 0.2s ease;
}

.remember-me-custom:hover input ~ .checkmark-custom {
  border-color: rgba(255, 255, 255, 0.2);
}

.remember-me-custom input:checked ~ .checkmark-custom {
  background-color: var(--color-green);
  border-color: var(--color-green);
}

.checkmark-custom::after {
  content: "";
  position: absolute;
  display: none;
}

.remember-me-custom input:checked ~ .checkmark-custom::after {
  display: block;
}

.remember-me-custom .checkmark-custom::after {
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #050811;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link-custom {
  background: none;
  border: none;
  color: var(--color-green);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-family);
  padding: 0;
  transition: filter 0.2s ease;
}

.forgot-link-custom:hover {
  filter: brightness(1.2);
  text-decoration: underline;
}

/* Buttons */
.btn-submit-custom {
  width: 100%;
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-blue) 100%);
  border: none;
  color: #050811;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(0, 245, 160, 0.12);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-submit-custom::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.6s ease;
}

.btn-submit-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 245, 160, 0.2);
  filter: brightness(1.05);
}

.btn-submit-custom:hover::after {
  left: 100%;
}

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

.separator-custom {
  display: flex;
  align-items: center;
  text-align: center;
  color: #475569;
  margin: 12px 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.separator-custom::before,
.separator-custom::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.separator-custom:not(:empty)::before {
  margin-right: .5em;
}

.separator-custom:not(:empty)::after {
  margin-left: .5em;
}

.btn-passkey-custom {
  width: 100%;
  background: rgba(0, 179, 255, 0.05);
  border: 1px solid rgba(0, 179, 255, 0.2);
  color: var(--color-blue);
  padding: 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-passkey-custom:hover {
  background: rgba(0, 179, 255, 0.1);
  border-color: var(--color-blue);
  color: #ffffff;
}

.btn-github-custom {
  width: 100%;
  background: #0c111d;
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-github-custom:hover {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-github-custom i {
  font-size: 1.2rem;
}

.card-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.78rem;
}

.status-page-link,
.crafty-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.status-page-link:hover,
.crafty-link:hover {
  color: var(--color-green);
}

.divider {
  color: #475569;
}

/* Error Field */
#error-field {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: center;
}

#error-field:empty {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .portal-centered-container {
    padding: 12px;
  }
  
  .portal-title {
    font-size: 1.8rem;
  }
  
  .portal-login-card {
    padding: 20px 18px;
    border-radius: 16px;
  }
}
