/* ============================================================
   EIN Plugin — Frontend Styles
   ============================================================ */

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

/* ── Reset & Base ─────────────────────────────────────────── */
.ein-wrap {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  box-sizing: border-box;
}

/* ── Auth Card (login page) ──────────────────────────────── */
.ein-auth-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 40px;
  text-align: center;
}

.ein-auth-logo {
  margin-bottom: 28px;
}
.ein-auth-logo img { max-height: 56px; }
.ein-auth-logo h2  { font-size: 22px; font-weight: 700; color: #4f46e5; margin: 0; }

.ein-auth-headline {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ein-auth-sub {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 28px;
}

/* ── Form Fields ─────────────────────────────────────────── */
.ein-field-group {
  margin-bottom: 20px;
  text-align: left;
}
.ein-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.ein-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.ein-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  background: #fff;
}

/* ── OTP Digit Boxes ─────────────────────────────────────── */
.ein-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 28px;
}
.ein-otp-digit {
  width: 52px;
  height: 60px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #4f46e5;
  background: #f8fafc;
  transition: border-color .2s, background .2s;
  outline: none;
  -webkit-appearance: none;
}
.ein-otp-digit:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.ein-otp-digit.filled {
  background: #ede9fe;
  border-color: #6d28d9;
}

/* ── Buttons ──────────────────────────────────────────────── */
.ein-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  line-height: 1;
}
.ein-btn--primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.ein-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,.4);
}
.ein-btn--primary:active { transform: translateY(0); }
.ein-btn--primary[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.ein-btn--outline {
  background: transparent;
  color: #4f46e5;
  border: 2px solid #4f46e5;
}
.ein-btn--outline:hover {
  background: #ede9fe;
}

.ein-btn--sm {
  padding: 8px 18px;
  font-size: 13px;
}

.ein-link-btn {
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.ein-link-btn:hover { color: #3730a3; }

/* Spinner */
.ein-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ein-spin .7s linear infinite;
  display: inline-block;
}
@keyframes ein-spin { to { transform: rotate(360deg); } }

/* ── Messages ─────────────────────────────────────────────── */
.ein-message {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.ein-message.ein-msg--success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.ein-message.ein-msg--error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ein-notice {
  display: block;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.ein-notice--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Resend / Back ────────────────────────────────────────── */
.ein-resend, .ein-back {
  font-size: 13px;
  color: #64748b;
  margin-top: 16px;
}

/* ── Dashboard Header ─────────────────────────────────────── */
.ein-dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}
.ein-dash-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}
.ein-dash-sub {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}
.ein-muted { color: #94a3b8; }

/* ── Section ──────────────────────────────────────────────── */
.ein-section { margin-bottom: 40px; }
.ein-section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #1e293b;
}

/* ── Application Cards ────────────────────────────────────── */
.ein-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.ein-app-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.ein-app-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.ein-app-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.ein-app-id { font-size: 12px; color: #94a3b8; font-weight: 600; }

.ein-app-card__body {
  padding: 16px 20px;
}
.ein-app-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #f1f5f9;
  font-size: 13px;
}
.ein-app-field:last-child { border-bottom: none; }
.ein-app-field__label { color: #64748b; flex-shrink: 0; }
.ein-app-field__value { font-weight: 500; text-align: right; word-break: break-word; }

.ein-app-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}
.ein-app-date { font-size: 12px; color: #94a3b8; }

/* ── Status Pills ─────────────────────────────────────────── */
.ein-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.ein-status-pill--submitted     { background: #dbeafe; color: #1e40af; }
.ein-status-pill--under-review  { background: #fef3c7; color: #92400e; }
.ein-status-pill--approved      { background: #d1fae5; color: #065f46; }
.ein-status-pill--rejected      { background: #fee2e2; color: #991b1b; }
.ein-status-pill--on-hold       { background: #e5e7eb; color: #374151; }

/* ── Empty State ──────────────────────────────────────────── */
.ein-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #f8fafc;
  border-radius: 14px;
  border: 2px dashed #e2e8f0;
  color: #64748b;
  font-size: 15px;
}
.ein-empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ── Edit Application Page ────────────────────────────────── */
.ein-edit-card {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  padding: 32px;
  margin-bottom: 20px;
}
.ein-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.ein-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ein-form-actions .ein-btn--primary { width: auto; }

.ein-app-meta-box {
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
  font-size: 13px;
  color: #64748b;
}
.ein-app-meta-box p { margin: 4px 0; }
.ein-app-meta-box strong { color: #374151; }

/* ── Back Link ────────────────────────────────────────────── */
.ein-back-link {
  color: #4f46e5;
  font-size: 13px;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
}
.ein-back-link:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 600px ) {
  .ein-auth-card  { padding: 32px 24px; }
  .ein-otp-digit  { width: 42px; height: 50px; font-size: 20px; }
  .ein-dash-header { flex-direction: column; }
  .ein-form-actions { flex-direction: column; }
  .ein-form-actions .ein-btn { width: 100%; }
}
