/* NIS — Cloud access via Google sign-in */

.cloud-gate-dialog {
  border: none;
  padding: 0;
  margin: auto;
  max-width: min(420px, calc(100vw - 32px));
  width: 100%;
  background: transparent;
}

.cloud-gate-dialog::backdrop {
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cloud-gate-card {
  padding: 26px 24px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(ellipse 100% 70% at 50% -30%, rgba(59, 130, 246, 0.18) 0%, transparent 55%),
    linear-gradient(165deg, #141824 0%, #0a0a0a 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  font-family: 'Sarabun', 'Inter', sans-serif;
  color: #f8fafc;
  animation: cloudGateIn 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes cloudGateIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cloud-gate-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.cloud-gate-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.cloud-gate-icon svg {
  width: 22px;
  height: 22px;
}

.cloud-gate-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cloud-gate-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #94a3b8;
}

.cloud-gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cloud-gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-gate-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
}

.cloud-gate-field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cloud-gate-field input:focus {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cloud-gate-error {
  font-size: 0.82rem;
  color: #f87171;
  text-align: center;
  margin: 0;
}

.cloud-gate-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.cloud-gate-actions-single {
  margin-top: 8px;
}

.cloud-gate-btn-primary,
.cloud-gate-btn-cancel {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cloud-gate-btn-primary {
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.cloud-gate-btn-primary:hover {
  transform: translateY(-1px);
}

.cloud-gate-btn-primary.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.cloud-gate-btn-cancel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #cbd5e1;
}

.cloud-gate-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cloud-gate-btn-google {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.cloud-gate-btn-google:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.cloud-gate-btn-google.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.cloud-gate-google-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Portal cloud panel (index.html) */
.portal-cloud-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(10px);
  padding: 18px 20px;
}

.light-theme .portal-cloud-panel {
  background: rgba(255, 255, 255, 0.85);
}

.portal-cloud-panel-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-cloud-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: #60a5fa;
  flex-shrink: 0;
}

.portal-cloud-icon svg {
  width: 24px;
  height: 24px;
}

.portal-cloud-text {
  flex: 1;
  min-width: 200px;
}

.portal-cloud-text h3 {
  margin: 0 0 4px;
  font-family: var(--font-thai);
  font-size: 1rem;
  font-weight: 700;
}

.portal-cloud-text p {
  margin: 0;
  font-family: var(--font-thai);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-cloud-text p.is-connected {
  color: #34d399;
}

.portal-cloud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: var(--text);
  font-family: var(--font-thai);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.portal-cloud-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.7);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0.16) 100%);
}

.portal-cloud-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.portal-cloud-btn.is-hidden {
  display: none;
}

.portal-cloud-btn svg {
  width: 18px;
  height: 18px;
}
