/**
 * MødeReferat Account Page Styles
 */

:root {
  --primary-color: #01849b;
  --primary-hover: #016d7f;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --error-color: #dc2626;
  --warning-color: #f59e0b;
  --success-color: #16a34a;
  --background: #f9fafb;
  --background-secondary: #f3f4f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Login Page */
body:not(.dashboard-body) {
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  margin: 0;
}

.login-container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Left side: Image */
.login-image {
  flex: 0 0 45%;
  position: relative;
  overflow: hidden;
}

.login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

/* Right side: Form */
.login-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 48px 80px 48px 30px;
  overflow-y: auto;
  background: #ffffff;
}

/* Logo header */
.logo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  max-width: 440px;
  width: 100%;
}

.logo-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.logo-text {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.login-box {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-width: 440px;
  width: 100%;
  flex-shrink: 0;
}

.logo {
  display: none;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: left;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  text-align: left;
  margin-bottom: 32px;
}

/* Forms */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

input[type='email'],
input[type='password'],
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
  background: var(--white);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder {
  color: #9ca3af;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-text {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

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

.btn-secondary:hover {
  background: var(--background);
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn-text:hover {
  color: var(--text-primary);
  background: var(--background);
}

.btn-primary.loading,
.btn-secondary.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* Messages */
#messageContainer {
  margin-bottom: 16px;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

.message.error {
  background: #fee2e2;
  color: var(--error-color);
  border: 1px solid #fecaca;
}

.message.success {
  background: #dcfce7;
  color: var(--success-color);
  border: 1px solid #bbf7d0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Code Input Container */
.code-input-container {
  width: 100%;
}

.code-instruction {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.code-inputs {
  display: flex;
  gap: 12px;
  justify-content: left;
  margin-bottom: 20px;
}

.code-inputs input {
  width: 56px;
  height: 56px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background);
  transition: all 0.2s ease;
}

.code-inputs input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(1, 132, 155, 0.1);
}

.code-inputs input.filled {
  border-color: var(--primary-color);
  background: var(--white);
}

/* Polling Status */
.polling-status {
  text-align: center;
  padding: 32px 16px;
}

.polling-status p {
  margin-top: 16px;
  color: var(--text-primary);
  font-weight: 500;
}

.polling-status small {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--background);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Footer Links and Language Selector Wrapper */
.footer-links-language {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  width: 100%;
  flex-shrink: 0;
}

/* Footer Links */
.footer-links {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  width: 100%;
}

/* Language Selector */
.language-selector {
  text-align: center;
  width: 100%;
}

.language-selector select {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-links span {
  color: var(--border-color);
}

/* Dashboard */
.dashboard-body {
  background: #f9f7f4;
  min-height: 100vh;
  display: flex;
  margin: 0;
}

/* Sidebar (Desktop) */
.dashboard-sidebar {
  width: 280px;
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: #6b7280;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 15px;
}

.sidebar-logout:hover {
  background: rgba(0,0,0,0.05);
  color: #1f2937;
}

.sidebar-logout svg {
  width: 20px;
  height: 20px;
}

/* Mobile Header (hidden on desktop) */
.mobile-header {
  display: none;
}

/* Main Content */
.dashboard-main {
  flex: 1;
  padding: 58px 84px;
  overflow-y: auto;
  background: #f9f7f4;
}

.dashboard-container {
  max-width: 800px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.loading-state,
.error-state {
  text-align: center;
  padding: 64px 16px;
  max-width: 800px;
  margin: 0 auto;
}

.loading-state p,
.error-state p {
  margin-top: 16px;
  color: var(--text-secondary);
}

.error-message {
  color: var(--error-color);
  font-size: 16px;
  margin-bottom: 24px;
}

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
  margin-bottom: 48px;
}

.card + .card {
  margin-top: 2em;
}

.card h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 24px;
  margin-top: 0;
}

/* Quota Card */
.quota-section {
  margin-bottom: 24px;
}

.quota-section:last-of-type {
  margin-bottom: 0;
}

.quota-label {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
}

.quota-reset,
.quota-info {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.quota-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Linear Progress Bar */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.progress-bar {
  flex: 1;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  transition: width 0.3s ease;
  border-radius: 12px;
}

.progress-text {
  font-size: 14px;
  color: #6b7280;
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

/* Status */
.quota-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9ca3af;
}

.quota-status svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Cancellation Notice */
.cancel-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  margin-top: 24px;
}

.cancel-notice svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #d97706;
}

.cancel-notice-title {
  font-size: 15px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
}

.cancel-notice-text {
  font-size: 14px;
  color: #78350f;
  line-height: 1.5;
}

/* Upgrade Card */
.upgrade-description {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.dashboard-footer {
  background: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: auto;
}

.dashboard-footer .footer-links {
  margin-top: 0;
  margin-bottom: 16px;
}

.footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  /* Login page responsive */
  .login-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .login-image {
    flex: 0 0 250px;
    max-height: 35vh;
  }

  .login-form-side {
    padding: 32px 24px;
    justify-content: flex-start;
    align-items: stretch;
    gap: 32px;
  }

  .login-box {
    max-width: 100%;
  }

  .footer-links-language,
  .logo-header {
    max-width: 100%;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 20px;
  }

  h2 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 14px;
  }

  .code-inputs input {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .code-inputs {
    gap: 8px;
  }

  /* Dashboard responsive */
  .dashboard-body {
    flex-direction: column;
  }

  .dashboard-sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f9f7f4;
    border-bottom: 1px solid #e0e0e0;
  }

  .mobile-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-header-left img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }

  .mobile-header-left span {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
  }

  .mobile-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
  }

  .mobile-logout:hover {
    background: rgba(0,0,0,0.05);
    color: #1f2937;
  }

  .dashboard-main {
    padding: 24px 16px;
  }

  .card {
    padding: 24px;
  }

  .card + .card {
    margin-top: 1.5em;
  }
}

@media (max-width: 480px) {
  /* Login page responsive */
  .login-form-side {
    padding: 24px 20px;
  }

  .login-image {
    flex: 0 0 230px;
  }

  h2 {
    font-size: 22px;
  }

  /* Dashboard responsive */
  .dashboard-main {
    padding: 32px 20px;
  }
  .container {
    padding: 0 16px;
  }
  .card {
    padding: 20px;
  }
  .progress-ring {
    width: 140px;
    height: 140px;
  }
  .progress-number {
    font-size: 32px;
  }
}
