/* login.css - Premium YouTube Studio / Estimated Analytics Login */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-base: #0b0c0e;
  --bg-card: rgba(20, 22, 26, 0.82);
  --bg-input: #121417;
  --bg-input-focus: #181b20;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3ea6ff;
  --yt-red: #ff0000;
  --yt-red-hover: #cc0000;
  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --accent-blue: #3ea6ff;
  --accent-blue-hover: #65b8ff;
  --danger-color: #ff4e45;
  --danger-bg: rgba(255, 78, 69, 0.12);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* Ambient dynamic background lighting */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-orb-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #ff0000 0%, #750000 70%, transparent 100%);
  top: -120px;
  left: -100px;
}

.ambient-orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #065fd4 0%, #033678 70%, transparent 100%);
  bottom: -150px;
  right: -100px;
  animation-duration: 22s;
  animation-delay: -5s;
}

.ambient-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #2ba640 0%, transparent 70%);
  top: 40%;
  right: 25%;
  opacity: 0.08;
  animation-duration: 26s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* Background grid pattern */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

/* Card Container */
.login-card-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(255, 255, 255, 0.08) inset;
}

/* Header branding */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-logo-img {
  height: 28px;
  display: block;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(62, 166, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(62, 166, 255, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.brand-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Error message banner */
.login-error-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--danger-bg);
  border: 1px solid rgba(255, 78, 69, 0.35);
  color: #ff9b96;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 22px;
  animation: shake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-error-banner.show {
  display: flex;
}

.login-error-banner svg {
  flex-shrink: 0;
  color: var(--danger-color);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 44px 13px 44px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(62, 166, 255, 0.2);
}

.form-input:focus + .input-icon,
.input-container:focus-within .input-icon {
  color: var(--accent-blue);
}

.input-action-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-action-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Options row */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.remember-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.remember-checkbox:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.remember-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Submit button */
.btn-submit {
  width: 100%;
  background: var(--accent-blue);
  color: #0b0c0e;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(62, 166, 255, 0.35);
  position: relative;
}

.btn-submit:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(62, 166, 255, 0.45);
}

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

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

/* Spinner inside button */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.loading .btn-spinner {
  display: inline-block;
}

.btn-submit.loading .btn-text {
  display: none;
}

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

/* Footer note & credentials helper */
.login-footer {
  margin-top: 26px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.credentials-hint {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.credentials-hint strong {
  color: var(--text-primary);
}

.credentials-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  color: #8ab4f8;
  font-size: 11.5px;
}

.prefill-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.prefill-link:hover {
  text-decoration: underline;
  color: var(--accent-blue-hover);
}
