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

:root {
  --bg:                #000000;
  --bg-elevated:       #080808;
  --bg-card:           #0a0a0a;
  --bg-card-hover:     #111111;
  --bg-input:          #050505;
  --bg-input-hover:    #0c0c0c;

  --text:              #f0f0f0;
  --text-secondary:    #888888;
  --text-tertiary:     #555555;
  --text-disabled:     #2a2a2a;
  --text-inverse:      #000000;
  --text-link:         #2cc970;

  --accent:            #2cc970;
  --accent-hover:      #24b05f;
  --accent-active:     #1d9a51;
  --accent-light:      rgba(44, 201, 112, 0.07);
  --accent-mid:        rgba(44, 201, 112, 0.15);

  --green:             #2cc970;
  --green-bg:          rgba(44, 201, 112, 0.08);
  --red:               #e74c4c;
  --red-bg:            rgba(231, 76, 76, 0.08);
  --yellow:            #f0b429;
  --yellow-bg:         rgba(240, 180, 41, 0.08);
  --blue:              #5b8def;
  --blue-bg:           rgba(91, 141, 239, 0.08);

  --border:            #1a1a1a;
  --border-light:      #0f0f0f;

  --font-sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs:      0.75rem;
  --font-size-sm:      0.8125rem;
  --font-size-base:    0.9375rem;
  --font-size-md:      1.0625rem;
  --font-size-lg:      1.25rem;
  --font-size-xl:      1.5rem;
  --font-size-2xl:     2rem;
  --font-size-3xl:     2.75rem;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-16: 64px; --space-20: 80px;

  --radius-sm: 6px; --radius-md: 10px;
  --radius-lg: 14px; --radius-xl: 18px;
  --radius-full: 9999px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

::placeholder {
  color: var(--text-disabled);
  opacity: 1;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.fade-in {
  animation: fadeIn 0.5s var(--bounce) both;
}

.fade-in-up {
  animation: fadeInUp 0.5s var(--bounce) both;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: var(--font-size-2xl); letter-spacing: -0.025em; }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-md); }

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-5);
  animation: fadeIn 0.5s var(--bounce) both;
}

.container--wide {
  max-width: 1100px;
}

.page-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  animation: fadeInUp 0.4s var(--bounce) both;
}

.page-header h1 {
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.page-header p {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-5);
}

.login-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: fadeInUp 0.6s var(--bounce) both;
}

.login-card h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.login-card p {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-7);
  line-height: 1.7;
}

.login-card .btn {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.login-card .btn svg {
  transition: transform var(--transition);
}

.login-card .btn:hover svg {
  transform: scale(1.12);
}

.content-area {
  display: none;
}

.content-area.visible {
  display: block;
}

.hero {
  text-align: center;
  padding: var(--space-12) var(--space-5) var(--space-8);
  animation: fadeInUp 0.5s var(--bounce) both;
}

.hero h1 {
  margin-bottom: var(--space-2);
  font-size: var(--font-size-2xl);
}

.hero p {
  font-size: var(--font-size-sm);
  max-width: 480px;
  margin: 0 auto;
  color: var(--text-tertiary);
}

.hero + .container {
  animation: fadeIn 0.5s var(--bounce) both;
  animation-delay: 0.1s;
}

.apps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.apps-grid .app-card:nth-child(1) { animation: fadeInUp 0.5s var(--bounce) both; animation-delay: 0.1s; }
.apps-grid .app-card:nth-child(2) { animation: fadeInUp 0.5s var(--bounce) both; animation-delay: 0.2s; }

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.app-card:hover {
  border-color: #222;
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.app-card:hover::before {
  opacity: 0.5;
}

.app-card h3 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-2);
}

.app-card p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  color: #000;
  background: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  color: #000;
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-active);
}

.btn-secondary {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn-success {
  color: #000;
  background: var(--green);
  font-weight: 600;
}

.btn-success:hover {
  background: #24b05f;
}

.btn-success:active:not(:disabled) {
  background: #1d9a51;
}

.btn-danger {
  color: #fff;
  background: var(--red);
}

.btn-danger:hover {
  background: #d43b3b;
}

.btn-danger:active:not(:disabled) {
  background: #b52e2e;
}

.btn-small {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
}

.form-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  animation: fadeIn 0.4s var(--bounce) both;
}

.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.1s; }
.form-section:nth-child(3) { animation-delay: 0.15s; }
.form-section:nth-child(4) { animation-delay: 0.2s; }

.form-section-header {
  margin-bottom: var(--space-4);
}

.form-section-header h4 {
  font-size: var(--font-size-sm);
  color: var(--accent);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.form-section-header p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.required-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: var(--space-2);
  vertical-align: middle;
}

.required-badge--optional {
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid var(--border);
}

.form-hint {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 3px;
}

.form-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  animation: fadeInUp 0.4s var(--bounce) both;
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  transition: color var(--transition);
}

.form-group:focus-within label {
  color: var(--accent);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  transition: border-color var(--transition), background var(--transition);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  background: var(--bg-input-hover);
  border-color: #222;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-input-hover);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-disabled);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
}

.auth-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: 720px;
  margin: 0 auto var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--red-bg);
  border: 1px solid rgba(231, 76, 76, 0.12);
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.4s var(--bounce) both;
}

.auth-warning-icon svg {
  animation: pulse 3s ease-in-out infinite;
}

.auth-warning-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(231, 76, 76, 0.1);
  border-radius: var(--radius-sm);
  color: var(--red);
}

.auth-warning-text strong {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--red);
  margin-bottom: 2px;
}

.auth-warning-text p {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0;
}

.auth-warning-text a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pending {
  color: var(--yellow);
  background: var(--yellow-bg);
  border: 1px solid rgba(240, 180, 41, 0.12);
}

.status-pending::before {
  background: var(--yellow);
  animation: pulse 2s ease-in-out infinite;
}

.status-approved {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid rgba(44, 201, 112, 0.12);
}

.status-approved::before {
  background: var(--green);
}

.status-denied {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(231, 76, 76, 0.12);
}

.status-denied::before {
  background: var(--red);
}

.toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  z-index: 300;
  animation: toastIn 0.4s var(--bounce);
  pointer-events: none;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.toast-info {
  color: var(--blue);
  background: var(--bg-elevated);
  border: 1px solid rgba(91, 141, 239, 0.2);
}

.toast-success {
  color: var(--green);
  background: var(--bg-elevated);
  border: 1px solid rgba(44, 201, 112, 0.2);
}

.toast-error {
  color: var(--red);
  background: var(--bg-elevated);
  border: 1px solid rgba(231, 76, 76, 0.2);
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.app-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
}

.app-item:hover {
  border-color: #222;
  background: var(--bg-input-hover);
}

.app-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1px;
}

.app-date {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.submissions-info {
  max-width: 720px;
  margin: 0 auto var(--space-6);
  animation: fadeInUp 0.4s var(--bounce) both;
}

.submissions-info h3 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 0.3s var(--bounce) both;
}

.modal h2 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.modal .meta {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

.modal .meta strong {
  color: var(--text);
}

.qa-section {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.qa-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.question {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-1);
}

.answer {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.review-actions {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-actions textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
  min-height: 54px;
  transition: border-color var(--transition), background var(--transition);
}

.review-actions textarea:hover {
  background: var(--bg-input-hover);
  border-color: #222;
}

.review-actions textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-input-hover);
}

.review-actions textarea::placeholder {
  color: var(--text-disabled);
}

.review-actions > div {
  display: flex;
  gap: var(--space-2);
}

.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select,
.filter-bar input[type="text"] {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-xs);
  transition: border-color var(--transition), background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.filter-bar select:hover,
.filter-bar input[type="text"]:hover {
  border-color: #222;
  background: var(--bg-input-hover);
}

.filter-bar select:focus,
.filter-bar input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-bar select {
  cursor: pointer;
  min-width: 140px;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23555'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-bar input[type="text"] {
  flex: 1;
  min-width: 180px;
}

.filter-bar input[type="text"]::placeholder {
  color: var(--text-disabled);
}

.applications-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeIn 0.4s ease both;
}

.applications-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.applications-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.applications-table tbody tr:last-child td {
  border-bottom: none;
}

.applications-table tbody tr {
  transition: background var(--transition);
}

.applications-table tbody tr:hover {
  background: var(--accent-light);
}

.applications-table td strong {
  color: var(--text);
  font-weight: 600;
}

.applications-table td .user-sub {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.applications-table .actions-cell {
  white-space: nowrap;
}

.loading {
  text-align: center;
  padding: var(--space-10);
  color: var(--text-tertiary);
  animation: fadeIn 0.3s ease both;
}

.loading p {
  animation: pulse 2s ease-in-out infinite;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto var(--space-3);
}

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

@media (max-width: 768px) {
  .applications-table th:nth-child(5),
  .applications-table td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: var(--space-6) var(--space-4);
  }

  .hero {
    padding: var(--space-8) var(--space-4) var(--space-6);
  }

  .hero h1 {
    font-size: var(--font-size-xl);
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .form-container {
    padding: var(--space-5);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select,
  .filter-bar input[type="text"] {
    width: 100%;
    min-width: unset;
  }

  .applications-table {
    font-size: var(--font-size-xs);
  }

  .applications-table th:nth-child(1),
  .applications-table td:nth-child(1) {
    display: none;
  }

  .modal {
    padding: var(--space-5);
    max-height: 90vh;
    margin: var(--space-3);
    border-radius: var(--radius-lg);
  }

  .review-actions > div {
    flex-direction: column;
  }

  .review-actions .btn {
    width: 100%;
  }

  .login-card h1 {
    font-size: var(--font-size-2xl);
  }
}
