/* === SwishEmail Webmail Shared Styles === */

:root {
  --swish-green: #01a200;
  --swish-green-dark: #047c00;
  --swish-green-hover: #018f00;
  --swish-green-soft: #eaf8ea;
  --swish-green-soft-2: #f3fbf3;

  --text-main: #151515;
  --text-strong: #172017;
  --text-muted: #5f6368;
  --text-soft: #7a867a;
  --text-light: #ffffff;

  --bg-main: #f7f9f7;
  --bg-card: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-panel-strong: #ffffff;
  --bg-section: #fbfdfb;

  --border-soft: #e2e8e2;
  --border-strong: #d2ddd2;

  --danger: #b42318;
  --danger-dark: #8f1d15;
  --danger-soft: #fff1f1;
  --danger-bg: #fff1f1;
  --danger-border: #ffd7d7;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 16px 38px rgba(18, 32, 18, 0.07);
  --shadow-hover: 0 16px 40px rgba(1, 162, 0, 0.14);
  --shadow-strong: 0 22px 60px rgba(0, 0, 0, 0.18);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --sidebar-width: 280px;
  --app-gradient:
    radial-gradient(circle at top left, rgba(1, 162, 0, 0.1), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(1, 162, 0, 0.05), transparent 28rem),
    linear-gradient(135deg, #f8fbf8 0%, #eef5ef 100%);
}

/* === Base Reset === */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button[disabled],
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

/* === Focus States === */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.compose-editor:focus-visible {
  outline: 3px solid rgba(1, 162, 0, 0.28);
  outline-offset: 3px;
}

/* === Shared Brand === */

.brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 45%),
    linear-gradient(135deg, var(--swish-green), var(--swish-green-dark));
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 900;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(1, 162, 0, 0.22);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 1.35rem;
  border-radius: 13px;
}

/* === Shared Typography === */

.app-title,
.panel-title {
  color: var(--text-strong);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.muted {
  color: var(--text-muted);
}

.eyebrow {
  display: inline-flex;
  color: var(--swish-green);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* === Shared Forms === */

label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  color: #263326;
  font-size: 0.95rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-strong);
  outline: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.025);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa19a;
}

input:focus,
textarea:focus,
select:focus,
.compose-editor:focus {
  border-color: rgba(1, 162, 0, 0.5);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(1, 162, 0, 0.12);
}

/* === Shared Buttons === */

button[type="submit"],
.primary-button,
.compose-button {
  width: 100%;
  min-height: 46px;
  margin-top: 1.25rem;
  padding: 0.82rem 1rem;
  border: 1px solid var(--swish-green);
  border-radius: 999px;
  background: var(--swish-green);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(1, 162, 0, 0.22);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.12s ease,
    opacity 0.2s ease;
}

button[type="submit"]:hover,
.primary-button:hover,
.compose-button:hover {
  background: var(--swish-green-hover);
  border-color: var(--swish-green-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

button[type="submit"]:active,
.primary-button:active,
.compose-button:active {
  transform: translateY(1px);
}

.secondary-button,
.ghost-button,
.sidebar-footer button {
  min-height: 42px;
  padding: 0.68rem 0.85rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-strong);
  font-weight: 850;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.035);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.secondary-button:hover,
.ghost-button:hover,
.sidebar-footer button:hover {
  background: var(--swish-green-soft);
  border-color: rgba(1, 162, 0, 0.24);
  color: var(--swish-green);
  transform: translateY(-1px);
}

/* === Shared Messages === */

.message {
  min-height: 1.4rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text-muted);
}

.message.success {
  color: #047857;
}

.message.error,
.error-box {
  color: var(--danger);
}

/* === Shared Sidebar Footer === */

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

/* === Shared Form Helper Text === */

.form-helper {
  margin: -0.35rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* === Shared Scrollbars === */

.mailbox-list,
.message-list,
.reader-panel,
.contacts-list,
.modal-card,
.settings-main {
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 162, 0, 0.35) transparent;
}

.mailbox-list::-webkit-scrollbar,
.message-list::-webkit-scrollbar,
.reader-panel::-webkit-scrollbar,
.contacts-list::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.settings-main::-webkit-scrollbar {
  width: 10px;
}

.mailbox-list::-webkit-scrollbar-thumb,
.message-list::-webkit-scrollbar-thumb,
.reader-panel::-webkit-scrollbar-thumb,
.contacts-list::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.settings-main::-webkit-scrollbar-thumb {
  background: rgba(1, 162, 0, 0.22);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.mailbox-list::-webkit-scrollbar-thumb:hover,
.message-list::-webkit-scrollbar-thumb:hover,
.reader-panel::-webkit-scrollbar-thumb:hover,
.contacts-list::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.settings-main::-webkit-scrollbar-thumb:hover {
  background: rgba(1, 162, 0, 0.38);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

/* === Responsive Shared Tweaks === */

@media (max-width: 700px) {
  body {
    background: var(--bg-main);
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .brand-mark.small {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}