/* Base styles for templates that extend base.html.
   This file is intentionally lightweight and prevents 404s for /static/css/style.css. */

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc 0%, #fff7ed 55%, #ecfdf5 100%);
}

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

.login-wrap {
  width: 100%;
  max-width: 420px;
}

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

.login-logo-image {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
  padding: 2.5rem;
}

.login-message {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.login-message-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.login-message-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  font-size: 1rem;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}

.login-input::placeholder {
  color: #94a3b8;
}

.login-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-submit-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  margin-top: 0.5rem;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-register-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 1.5rem auto 0;
  padding: 0.875rem 1.5rem;
  text-align: center;
  text-decoration: none;
  background: #ffffff;
  color: #3b82f6;
  border: 2px solid #3b82f6;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.login-register-btn:hover {
  background: #3b82f6;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Verification page styles */
.verify-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
}

.verify-text {
  margin: 0;
  color: #1e40af;
  font-size: 0.95rem;
  text-align: center;
}

.verify-text strong {
  color: #1e3a8a;
  font-weight: 700;
}

.verify-resend-form {
  margin-top: 1rem;
}

.verify-resend-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #64748b;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.verify-resend-btn:hover {
  background: #64748b;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.verify-timer {
  margin: 1rem 0 0;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.verify-timer strong {
  color: #475569;
  font-weight: 700;
}

/* Login footer links */
.login-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
}

.login-text-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.login-text-link:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* Password reset styles */
.password-reset-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
}

.password-reset-info p {
  margin: 0;
  color: #1e40af;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.5;
}

.password-reset-info strong {
  color: #1e3a8a;
  font-weight: 700;
}

.captcha-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.captcha-question {
  flex: 0 0 auto;
  padding: 0.875rem 1rem;
  background: #fef3c7;
  border: 2px solid #fde68a;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #92400e;
  text-align: center;
  min-width: 120px;
}

.captcha-input {
  flex: 1;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem;
  max-width: 450px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-text {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.modal-text strong {
  color: #1e40af;
  font-weight: 600;
}

.modal-btn {
  margin-top: 1.5rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  min-width: 150px;
}

.modal-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.modal-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .login-shell {
    padding: 1.5rem 1rem;
  }
  .login-card {
    padding: 2rem 1.5rem;
  }
  .login-logo-image {
    width: 150px;
    height: 150px;
  }
}

.cabinet-shell {
  min-height: 100vh;
  padding: 2rem 1rem;
}

.cabinet-wrap {
  max-width: 920px;
  margin: 0 auto;
}

.cabinet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cabinet-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cabinet-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.cabinet-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.cabinet-header p {
  margin: 0.35rem 0 0;
  color: #475569;
}

.cabinet-logout {
  display: inline-block;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  color: #0f172a;
  text-decoration: none;
  background: #e2e8f0;
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cabinet-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  padding: 1.25rem;
}

.cabinet-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.tariff-card {
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
}

.tariff-card:hover {
  border-color: #93c5fd;
}

.tariff-duration {
  margin: 0 0 0.35rem;
  color: #475569;
}

.tariff-price {
  margin: 0;
  font-size: 1.1rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  width: min(320px, calc(100vw - 2rem));
  text-align: center;
}

.modal-ok {
  display: inline-block;
  text-decoration: none;
  margin-top: .5rem;
}

.cabinet-field { margin-bottom: .9rem; }
.cabinet-label { display:block; color:#475569; font-size:.88rem; margin-bottom:.25rem; }
.cabinet-value { display:block; font-weight:600; word-break: break-word; }
.cabinet-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.cabinet-status {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
}

.cabinet-status.is-active { background:#dcfce7; color:#166534; }
.cabinet-status.is-inactive { background:#fef3c7; color:#92400e; }

.config-link {
  transition: background-color 0.2s ease;
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin: -0.5rem;
}

.config-link:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

.config-link:active {
  background-color: rgba(37, 99, 235, 0.1);
}

.copy-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .cabinet-grid { grid-template-columns: 1fr; }
  .cabinet-header { flex-direction: column; align-items: flex-start; }
  .copy-hint {
    font-size: 0.8rem;
  }
}

/* Action list styles */
.cabinet-actions {
  padding: 0;
  overflow: hidden;
}

.cabinet-actions h2 {
  padding: 1.5rem 1.5rem 1rem;
  margin: 0;
  font-size: 1.3rem;
  border-bottom: 2px solid #e2e8f0;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.action-btn-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-btn-text {
  flex: 1;
  text-align: center;
}

.action-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.action-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.action-btn-secondary {
  background: #f8fafc;
  color: #0f172a;
  border: 2px solid #e2e8f0;
}

.action-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn-info {
  background: #fef3c7;
  color: #92400e;
  border: 2px solid #fde68a;
}

.action-btn-info:hover {
  background: #fde68a;
  border-color: #fbbf24;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.action-btn-promo {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 2px solid #10b981;
}

.action-btn-promo:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.action-btn-logout {
  background: #fee2e2;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.action-btn-logout:hover {
  background: #fecaca;
  border-color: #f87171;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

@media (max-width: 768px) {
  .action-list {
    padding: 1rem;
    gap: 0.625rem;
  }
  .action-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }
  .action-btn-icon {
    font-size: 1.25rem;
  }
}

/* Subscriptions page styles */
.subscriptions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subscription-card {
  border-left: 4px solid #cbd5e1;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
}

.subscription-active {
  border-left-color: #16a34a;
}

.subscription-pending {
  border-left-color: #f59e0b;
}

.subscription-expired {
  border-left-color: #dc2626;
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 0.65rem;
}

.subscription-header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  flex: 1;
}

.subscription-status {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-expired {
  background: #fee2e2;
  color: #991b1b;
}

.subscription-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.4rem;
}

.subscription-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.subscription-label {
  font-size: 0.8rem;
  color: #64748b;
}

.subscription-value {
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .subscription-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .subscription-details {
    grid-template-columns: 1fr;
  }
}

/* Platforms grid */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.platform-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.platform-card:hover {
  border-color: #3b82f6;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
}

.platform-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.platform-name {
  flex: 1;
  font-weight: 700;
  font-size: 1.1rem;
}

.platform-arrow {
  font-size: 1.5rem;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.platform-card:hover .platform-arrow {
  color: #3b82f6;
  transform: translateX(4px);
}

/* Instruction steps */
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.instruction-step {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.step-number {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #0f172a;
}

.step-description {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.step-detail {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border-left: 3px solid #3b82f6;
}

@media (max-width: 768px) {
  .platforms-grid {
    grid-template-columns: 1fr;
  }
  .instruction-step {
    flex-direction: column;
    gap: 1rem;
  }
  .step-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }
  
  /* Compact subscription cards on mobile */
  .subscription-card {
    padding: 1rem;
  }
  .subscription-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .subscription-header h3 {
    font-size: 1rem;
  }
  .subscription-details {
    gap: 0.5rem;
  }
  .subscription-field {
    padding: 0.5rem;
  }
  .subscription-label {
    font-size: 0.8rem;
  }
  .subscription-value {
    font-size: 0.85rem;
  }
  .subscription-date-row {
    flex-direction: column;
    gap: 0.25rem;
  }
  .subscription-columns {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Subscription date rows */
.subscription-dates {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.subscription-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.22rem 0;
}

.subscription-date-row:not(:last-child) {
  border-bottom: none;
  margin-bottom: 0.2rem;
}

/* Subscription two-column layout */
.subscription-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.subscription-column {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Order summary styles */
.order-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.order-row.order-total {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #3b82f6;
  font-weight: 700;
}

.order-label {
  color: #64748b;
  font-size: 0.95rem;
}

.order-value {
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
}

.order-row.order-total .order-label,
.order-row.order-total .order-value {
  color: #1e40af;
  font-size: 1.1rem;
}

.promo-success {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 0.75rem;
}

.promo-success p {
  margin: 0 0 0.75rem;
  color: #16a34a;
  font-size: 1rem;
}

.promo-success strong {
  color: #15803d;
}

.promo-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
