@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===========================
   CSS Variables
=========================== */
:root {
  --green-dark:   #1a6b3c;
  --green-main:   #2e8b57;
  --green-light:  #4caf80;
  --green-pale:   #e8f5ee;
  --green-accent: #34d175;
  --white:        #ffffff;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-600:     #4b5563;
  --gray-800:     #1f2937;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --radius:       12px;
  --radius-sm:    8px;
  --transition:   0.2s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.5;
}

a { text-decoration: none; color: var(--green-main); transition: color var(--transition); }
a:hover { color: var(--green-dark); }

/* ===========================
   Auth Pages Layout
=========================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, var(--green-pale) 0%, var(--white) 60%);
}

/* ===========================
   Logo Header 88
=========================== */
.logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.logo-header img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 6px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

/* .logo-header img {
  width: 220px;
  height: auto;
  padding: 12px 18px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
} */

.logo-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: -0.3px;
}

.logo-header p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 4px;
}

/* ===========================
   Card
=========================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--gray-200);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.card .subtitle {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* ===========================
   Form Elements
=========================== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
  pointer-events: none;
}

.form-group input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--green-main);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(46,139,87,.12);
}

.form-group input.error {
  border-color: #ef4444;
}

.form-group .field-error {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

/* ===========================
   Buttons
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-main) 0%, var(--green-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(46,139,87,.35);
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46,139,87,.45);
}

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--green-main);
  color: var(--green-main);
  width: auto;
  padding: 8px 18px;
  font-size: 0.875rem;
}

.btn-outline:hover {
  background: var(--green-pale);
}

/* Spinner inside button */
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .btn-text { opacity: 0.6; }

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

/* ===========================
   Alert / Toast
=========================== */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 4px solid transparent;
  animation: slideDown .25s ease;
}

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

.alert.show { display: flex; align-items: flex-start; gap: 10px; }

.alert-success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}

.alert-error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* ===========================
   Divider / Footer link
=========================== */
.form-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.form-footer a { font-weight: 600; }

/* ===========================
   Dashboard Layout
=========================== */
.dashboard-page {
  min-height: 100vh;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
}

.navbar-brand .brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.1;
}

.navbar-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
  display: block;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.user-badge .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 40px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.greeting {
  margin-bottom: 32px;
}

.greeting h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
}

.greeting p {
  color: var(--gray-600);
  margin-top: 4px;
  font-size: 0.9375rem;
}

/* Info cards row */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.info-card .ic-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
  margin-bottom: 6px;
}

.info-card .ic-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.info-card .ic-badge {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 4px;
}

/* API Key card */
.apikey-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
}

.apikey-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.apikey-card .apikey-desc {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 20px;
}

.key-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: border-color var(--transition);
}

.key-display:hover { border-color: var(--green-light); }

.key-display .key-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.9375rem;
  color: var(--gray-800);
  word-break: break-all;
  letter-spacing: 0.5px;
  filter: blur(5px);
  transition: filter .3s;
  user-select: none;
}

.key-display .key-text.revealed { filter: none; user-select: text; }

.key-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  width: auto;
}

.btn-copy {
  border-color: var(--green-main);
  color: var(--green-main);
  background: transparent;
}

.btn-copy:hover { background: var(--green-pale); }
.btn-copy.copied { background: var(--green-main); color: white; border-color: var(--green-main); }

.btn-reveal {
  border-color: var(--gray-200);
  color: var(--gray-600);
  background: transparent;
}
.btn-reveal:hover { background: var(--gray-100); }

.key-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 600px) {
  .card { padding: 28px 20px; }
  .navbar { padding: 0 16px; }
  .main-content { padding: 24px 16px; }
  .info-grid { grid-template-columns: 1fr; }
}
