/* Custom styles for Finturf SSO Service */

/* Import Tailwind via CDN - In production, consider using PostCSS */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@3.4.0/base.css');

/* Custom color variables based on style guide */
:root {
  /* Gray Scale */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #212121;
  --color-gray-900: #111827;
  
  /* Semantic Colors */
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  
  --color-green-100: #dcfce7;
  --color-green-200: #e6f5e6;
  --color-green-600: #8fc28e;
  --color-green-700: #7ab27e;
  --color-green-800: #16a34a;
  
  --color-red-50: #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-200: #fecaca;
  --color-red-600: #dc2626;
  --color-red-700: #b91c1c;
  --color-red-800: #991b1b;
  
  --color-yellow-50: #fefce8;
  --color-yellow-200: #fef08a;
  --color-yellow-600: #ca8a04;
  --color-yellow-700: #a16207;
  
  /* Spacing */
  --spacing: 0.25rem;
  
  /* Border Radius */
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  
  /* Transitions */
  --transition-duration: 200ms;
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base font stack */
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
}

/* Typography */
h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.5rem;
}

/* Layout Components */
.min-h-screen {
  min-height: 100vh;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

/* Navigation */
.navbar {
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 64px;
}

.navbar-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-link {
  color: var(--color-gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-duration) var(--transition-timing);
}

.navbar-link:hover {
  color: var(--color-gray-900);
}

/* Content wrapper with top padding for fixed navbar */
.content-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 1.5rem;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-gray-200);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  background: white;
  transition: all var(--transition-duration) var(--transition-timing);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-duration) var(--transition-timing);
  line-height: 1.25rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-gray-800);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-gray-900);
}

.btn-secondary {
  background: white;
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-50);
}

.btn-success {
  background: var(--color-green-600);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: var(--color-green-700);
}

.btn-danger {
  background: var(--color-red-600);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-red-700);
}

.btn-info {
  background: var(--color-blue-600);
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: var(--color-blue-700);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: var(--color-green-100);
  border-left-color: var(--color-green-600);
  color: var(--color-green-800);
}

.alert-error {
  background: var(--color-red-50);
  border-left-color: var(--color-red-600);
  color: var(--color-red-800);
}

.alert-warning {
  background: var(--color-yellow-50);
  border-left-color: var(--color-yellow-600);
  color: var(--color-yellow-700);
}

.alert-info {
  background: #eff6ff;
  border-left-color: var(--color-blue-600);
  color: var(--color-blue-700);
}

/* API Key Display */
.api-key-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow var(--transition-duration) var(--transition-timing);
}

.api-key-item:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.api-key-info {
  flex-grow: 1;
}

.api-key-name {
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.25rem;
}

.api-key-meta {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  line-height: 1.5;
}

.new-key-display {
  background: var(--color-green-100);
  border: 2px solid var(--color-green-600);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.key-value {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  background: white;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  word-break: break-all;
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--color-gray-200);
  border-top: 3px solid var(--color-blue-600);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-800 { color: var(--color-gray-800); }
.text-gray-900 { color: var(--color-gray-900); }

.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }
.bg-white { background-color: white; }

.border { border-width: 1px; }
.border-gray-200 { border-color: var(--color-gray-200); }
.border-gray-300 { border-color: var(--color-gray-300); }

.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }

/* Responsive utilities */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Grid system */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gap-6 {
  gap: 1.5rem;
}

/* Hide/Show elements */
.hidden {
  display: none;
}

.block {
  display: block;
}

/* Links */
a {
  color: var(--color-blue-600);
  text-decoration: none;
  transition: color var(--transition-duration) var(--transition-timing);
}

a:hover {
  color: var(--color-blue-700);
  text-decoration: underline;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--color-gray-200);
  margin: 1.5rem 0;
}

/* Login page specific */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 28rem;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

/* Dashboard specific */
.dashboard-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.dashboard-header {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Redirect page */
.redirect-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.redirect-card {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-width: 28rem;
  width: 100%;
}