:root {
  --forest-950: #0b2018;
  --forest-900: #0f2a1f;
  --forest-800: #163a2a;
  --forest-700: #1f4d38;
  --forest-600: #2f6f4f;
  --amber-500: #c07a3e;
  --amber-400: #d59454;
  --ivory-100: #f6f3ec;
  --ivory-300: #d9d3c4;
  --danger: #e0645a;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ivory-100);
  background: radial-gradient(circle at 20% 20%, var(--forest-800), var(--forest-950) 60%);
  position: relative;
  overflow-x: hidden;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% 15%, rgba(192, 122, 62, 0.12), transparent 60%),
    radial-gradient(500px 500px at 10% 90%, rgba(47, 111, 79, 0.25), transparent 60%);
}

.topbar {
  position: relative;
  z-index: 1;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-mark {
  font-size: 20px;
  color: var(--ivory-100);
}

.brand-mark-accent {
  font-size: 20px;
  color: var(--amber-400);
}

.brand-sub {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--ivory-300);
  text-transform: uppercase;
}

.center-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: rgba(15, 42, 31, 0.75);
  border: 1px solid rgba(217, 211, 196, 0.12);
  border-radius: 16px;
  padding: 40px 36px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.card-wide {
  max-width: 620px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 600;
}

.card-subtitle {
  margin: 0 0 28px;
  color: var(--ivory-300);
  font-size: 14px;
}

.field {
  display: block;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ivory-300);
}

.field span {
  display: block;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(217, 211, 196, 0.2);
  background: rgba(11, 32, 24, 0.6);
  color: var(--ivory-100);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(192, 122, 62, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--amber-400), var(--amber-500));
  color: #241206;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  box-shadow: 0 8px 20px rgba(192, 122, 62, 0.3);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--ivory-300);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(217, 211, 196, 0.16);
}

.external-provider-list {
  display: grid;
  gap: 10px;
}

.btn-provider {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(217, 211, 196, 0.25);
  border-radius: 8px;
  background: rgba(246, 243, 236, 0.08);
  color: var(--ivory-100);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.btn-provider:hover {
  background: rgba(246, 243, 236, 0.14);
  border-color: rgba(217, 211, 196, 0.4);
}

.provider-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--ivory-100);
  color: var(--forest-950);
  font-size: 13px;
  font-weight: 700;
}

.btn-link {
  display: inline-block;
  margin-top: 24px;
  background: none;
  border: none;
  color: var(--ivory-300);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover {
  color: var(--ivory-100);
}

.error-text {
  margin: -6px 0 16px;
  color: var(--danger);
  font-size: 13px;
}

.hint-text {
  color: var(--ivory-300);
  font-size: 14px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 18px;
  margin-bottom: 8px;
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  border-radius: 12px;
  border: 1px solid rgba(217, 211, 196, 0.12);
  background: rgba(11, 32, 24, 0.45);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.app-tile:hover {
  transform: translateY(-3px);
  background: rgba(31, 77, 56, 0.55);
  border-color: rgba(192, 122, 62, 0.4);
}

.app-tile:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-name {
  font-size: 13px;
  text-align: center;
  color: var(--ivory-100);
  line-height: 1.3;
}

.page-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--ivory-300);
}

.admin-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-card {
  background: rgba(15, 42, 31, 0.75);
  border: 1px solid rgba(217, 211, 196, 0.12);
  border-radius: 16px;
  padding: 28px 32px;
}

.admin-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 20px;
}

.admin-table th {
  text-align: left;
  color: var(--ivory-300);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(217, 211, 196, 0.15);
}

.admin-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(217, 211, 196, 0.08);
  vertical-align: middle;
}

.table-action {
  margin: 0 8px 0 0;
  font-size: 12px;
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-form input,
.admin-form select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(217, 211, 196, 0.2);
  background: rgba(11, 32, 24, 0.6);
  color: var(--ivory-100);
  font-size: 14px;
}

.admin-form input[type="color"] {
  padding: 2px;
  width: 48px;
  height: 38px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ivory-300);
}

.btn-compact {
  width: auto;
  margin-top: 0;
  padding: 9px 18px;
}
