/* Sharp Insurance Portal - Custom Styles */

/* Color palette */
:root {
  --sharp-orange: #E8A317;
  --sharp-gold: #D4941A;
  --sharp-gold-dark: #B8860B;
  --sharp-green: #28a745;
  --sharp-green-dark: #1e7e34;
  --sharp-blue: #87CEEB;
  --sharp-red: #dc3545;
  --sharp-gray: #f5f5f5;
  --sharp-border: #ddd;
  --sharp-text: #333;
  --sharp-text-light: #666;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #f0f0f0;
  color: var(--sharp-text);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
}

.login-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  padding: 40px 35px;
  width: 350px;
  text-align: center;
}

.login-logo {
  width: 200px;
  margin-bottom: 25px;
}

.login-field {
  position: relative;
  margin-bottom: 12px;
}

.login-field input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.login-field input:focus {
  border-color: var(--sharp-orange);
}

.login-field .field-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 16px;
}

.forgot-link {
  text-align: right;
  margin-bottom: 15px;
}

.forgot-link a {
  color: var(--sharp-text-light);
  text-decoration: none;
  font-size: 13px;
}

.forgot-link a:hover {
  text-decoration: underline;
}

.forgot-section {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.forgot-section label {
  display: block;
  font-size: 13px;
  color: var(--sharp-text-light);
  margin-bottom: 8px;
}

.forgot-section input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
}

.password-hint {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: #856404;
  margin-bottom: 20px;
}

.btn-login {
  width: 100%;
  padding: 10px;
  background: linear-gradient(to bottom, #F0B429, #D4941A);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-login:hover {
  opacity: 0.9;
}

.or-separator {
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.or-separator img {
  width: 60px;
  height: 60px;
}

.magic-link-section {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  margin-top: 5px;
}

.magic-link-section label {
  display: block;
  font-size: 13px;
  color: var(--sharp-text-light);
  margin-bottom: 8px;
}

.magic-link-section input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
}

.btn-magic {
  width: 100%;
  padding: 10px;
  background: linear-gradient(to bottom, #F0B429, #D4941A);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.btn-magic:hover {
  opacity: 0.9;
}

/* Dashboard Header */
.dashboard-header {
  background: white;
  border-bottom: 1px solid var(--sharp-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 40px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--sharp-text);
}

.badge-online {
  background: var(--sharp-green);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
}

.user-icon {
  width: 28px;
  height: 28px;
  background: #5b6abf;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-logout {
  background: none;
  border: 1px solid var(--sharp-border);
  color: var(--sharp-text-light);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--sharp-red);
  color: white;
  border-color: var(--sharp-red);
}

/* Dashboard Content */
.dashboard-content {
  padding: 20px 30px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-style: italic;
  color: var(--sharp-orange);
  font-weight: bold;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--sharp-orange);
}

.section-title .icon {
  font-size: 22px;
}

/* Form fields */
.form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 20px;
}

.form-row label {
  min-width: 160px;
  padding-top: 8px;
  font-size: 14px;
  color: var(--sharp-text);
}

.form-row input,
.form-row select {
  flex: 1;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--sharp-orange);
}

.form-row input.error {
  border-color: var(--sharp-red);
}

.field-error {
  color: var(--sharp-red);
  font-size: 12px;
  margin-top: 2px;
}

.province-group {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
}

.province-group label {
  min-width: auto;
  white-space: nowrap;
}

.province-group select {
  min-width: 280px;
}

/* Buttons */
.btn-create {
  background: var(--sharp-orange);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  float: right;
}

.btn-create:hover {
  background: var(--sharp-gold-dark);
}

.btn-update {
  background: var(--sharp-gold);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.btn-update:hover {
  background: var(--sharp-gold-dark);
}

.btn-new-lead {
  background: var(--sharp-green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.btn-new-lead:hover {
  background: var(--sharp-green-dark);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 6px;
  width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--sharp-border);
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: normal;
  color: var(--sharp-text);
}

.modal-body {
  padding: 20px 25px;
}

/* Collapsible sections */
.collapsible-section {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 15px;
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
}

.collapsible-header .section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: bold;
  color: var(--sharp-orange);
}

.collapsible-header .section-label .icon {
  font-size: 20px;
}

.collapsible-header .check-badge {
  color: var(--sharp-green);
  font-size: 18px;
}

.collapsible-header .chevron {
  font-size: 18px;
  color: #666;
  transition: transform 0.2s;
}

.collapsible-body {
  padding: 16px;
  border-top: 1px solid #e0e0e0;
}

.collapsible-body.collapsed {
  display: none;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--sharp-green);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Vehicle form fields */
.vehicle-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  gap: 10px;
}

.vehicle-field .field-error {
  width: 100%;
  margin-top: -4px;
  margin-left: 70px;
}

.vehicle-field label {
  min-width: 60px;
  font-size: 14px;
  color: var(--sharp-text);
}

.vehicle-field .refresh-btn {
  background: none;
  border: none;
  color: #5bc0de;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.vehicle-field .refresh-btn:hover {
  color: #31b0d5;
}

.vehicle-field input,
.vehicle-field select {
  flex: 1;
  max-width: 350px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.vehicle-field input:focus,
.vehicle-field select:focus {
  border-color: var(--sharp-orange);
}

.vehicle-field input.error,
.vehicle-field select.error {
  border-color: var(--sharp-red);
}

/* Address Autocomplete */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--sharp-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sharp-text);
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: #fff8e7;
}

.autocomplete-item .addr-main {
  font-weight: 500;
}

.autocomplete-item .addr-secondary {
  font-size: 12px;
  color: var(--sharp-text-light);
  margin-top: 2px;
}

/* Notes textarea */
.notes-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.notes-textarea:focus {
  border-color: var(--sharp-orange);
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--sharp-orange);
  margin-top: 4px;
}

/* Modal footer */
.modal-footer {
  padding: 15px 25px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--sharp-border);
}

.btn-modal-create {
  background: var(--sharp-gold);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.btn-modal-create:hover {
  background: var(--sharp-gold-dark);
}

.btn-modal-cancel {
  background: var(--sharp-gold-dark);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.btn-modal-cancel:hover {
  opacity: 0.9;
}

/* Confirmation modal */
.confirmation-content {
  background: var(--sharp-blue);
  border-radius: 12px;
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 20px;
}

.confirmation-logo {
  width: 150px;
  min-width: 150px;
  height: auto;
}

.confirmation-text h2 {
  color: white;
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 15px 0;
}

.confirmation-text p {
  color: white;
  font-size: 20px;
  font-weight: bold;
  margin: 0;
}

.btn-close-confirm {
  background: #F0C040;
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  float: right;
  margin: 15px 20px;
}

.btn-close-confirm:hover {
  background: var(--sharp-gold);
}

/* Utility */
.hidden {
  display: none !important;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

/* Button loading state */
button.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* Error message */
.login-error {
  background: #fdecea;
  color: var(--sharp-red);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.login-error.visible {
  display: block;
}

/* Success message */
.login-success {
  background: #d4edda;
  color: #155724;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.login-success.visible {
  display: block;
}

/* ===== Admin Panel ===== */
.btn-admin-panel {
  background: none;
  border: 1px solid var(--sharp-orange);
  color: var(--sharp-orange);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-admin-panel:hover {
  background: var(--sharp-orange);
  color: white;
}

.btn-admin-panel.active {
  background: var(--sharp-orange);
  color: white;
}

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

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--sharp-border);
}

.admin-table th {
  background: #fafafa;
  font-weight: 600;
  color: var(--sharp-text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tr:hover {
  background: #f9f9f9;
}

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.role-admin {
  background: #fff3e0;
  color: #e65100;
}

.role-user {
  background: #f5f5f5;
  color: #666;
}

.status-active {
  color: var(--sharp-green);
  font-weight: bold;
  font-size: 13px;
}

.status-inactive {
  color: var(--sharp-red);
  font-weight: bold;
  font-size: 13px;
}

.btn-edit-user {
  background: none;
  border: 1px solid var(--sharp-gold);
  color: var(--sharp-gold);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 6px;
  transition: all 0.2s;
}

.btn-edit-user:hover {
  background: var(--sharp-gold);
  color: white;
}

.btn-toggle-user {
  background: none;
  border: 1px solid var(--sharp-red);
  color: var(--sharp-red);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.btn-toggle-user:hover {
  background: var(--sharp-red);
  color: white;
}

.btn-toggle-user.activate {
  border-color: var(--sharp-green);
  color: var(--sharp-green);
}

.btn-toggle-user.activate:hover {
  background: var(--sharp-green);
  color: white;
}

.btn-add-user {
  background: var(--sharp-green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.btn-add-user:hover {
  background: var(--sharp-green-dark);
}

/* Admin modal form fields */
.admin-form-row {
  margin-bottom: 14px;
}

.admin-form-row label {
  display: block;
  font-size: 13px;
  color: var(--sharp-text-light);
  margin-bottom: 4px;
}

.admin-form-row input,
.admin-form-row select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.admin-form-row input:focus,
.admin-form-row select:focus {
  border-color: var(--sharp-orange);
}

.admin-form-row .field-hint {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* Deactivation confirmation */
.confirm-deactivate-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--sharp-text);
  padding: 10px 0;
}

.confirm-deactivate-text strong {
  color: var(--sharp-red);
}

.admin-error {
  background: #fdecea;
  color: var(--sharp-red);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.admin-error.visible {
  display: block;
}
