/* 
  AltivisOne Client Portal CSS 
  Premium, modern, glassmorphism aesthetics
*/

:root {
  --bg-dark: #0a0e1a;
  --bg-panel: #111827;
  --bg-panel-light: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-violet: #8b5cf6;
  --accent-violet-hover: #7c3aed;
  --border-color: rgba(148, 163, 184, 0.1);
  --border-focus: rgba(59, 130, 246, 0.5);
  --success: #10b981;
  --warning: #f59e0b;
  --glass-bg: rgba(17, 24, 39, 0.7);
}

body.portal-body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Portal Login ─── */
.portal-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 2rem;
  background: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 60%);
}

.portal-login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.portal-login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.portal-login-box h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-login-box p.subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  cursor: pointer;
}

.auth-switch a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.error-message {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

.success-message {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

/* ─── Portal Layout (Dashboard & Subscriptions) ─── */
.portal-wrapper {
  display: flex;
  min-height: calc(100vh - 80px);
  background: var(--bg-dark);
}

.portal-sidebar {
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
}

.portal-user-profile {
  padding: 0 2rem 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.user-info h3 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}

.user-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.portal-nav li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.portal-nav li a:hover, .portal-nav li a.active {
  background: rgba(59, 130, 246, 0.05);
  color: var(--accent-blue);
  border-right: 3px solid var(--accent-blue);
}

.portal-main {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.portal-header h2 {
  font-size: 2rem;
  margin: 0;
}

/* Dashboard Cards */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent-blue);
}

/* Subscription List */
.subscription-list {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.subscription-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.subscription-item:last-child {
  border-bottom: none;
}

.sub-info h4 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.sub-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* Subscriptions Catalog */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.plan-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.plan-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border-color: rgba(59, 130, 246, 0.3);
}

.plan-card h3 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.plan-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 1.5rem;
}

.plan-price span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  flex: 1;
}

.plan-features li {
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.plan-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: bold;
}

.btn-outline {
  width: 100%;
  padding: 0.9rem;
  background: transparent;
  border: 1px solid var(--accent-blue);
  border-radius: 8px;
  color: var(--accent-blue);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content h3 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}
