:root {
  --goagle-bg: #f1f3f4;
  --goagle-card-bg: #f5f5f5;      /* light grey box */
  --goagle-border: #dadce0;
  --goagle-primary: #1a73e8;
  --goagle-text: #202124;
  --goagle-sub: #5f6368;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.goagle-body {
  background: var(--goagle-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overall wrapper so logo + text sit above the card */
.goagle-auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  text-align: center;
}

.goagle-logo {
  font-size: 42px;
  color: var(--goagle-primary);
  font-weight: 700;
}

.goagle-logo-center {
  margin-bottom: 4px;
}

.goagle-top-subtitle {
  font-size: 14px;
  color: var(--goagle-sub);
  margin-bottom: 16px;
}

/* Login card box */
.goagle-login-card {
  background: var(--goagle-card-bg);
  border-radius: 8px;
  border: 1px solid var(--goagle-border);
  padding: 40px 32px 20px;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.15);
}

/* Avatar at top of box */
.goagle-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.goagle-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goagle-avatar-icon {
  font-size: 32px;
}

/* Form and inputs */
.goagle-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goagle-input {
  border-radius: 4px;
  border: 1px solid var(--goagle-border);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--goagle-text);
}

.goagle-input::placeholder {
  color: rgba(0, 0, 0, 0.3); /* slightly faded */
}

.goagle-input:focus {
  outline: none;
  border-color: var(--goagle-primary);
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.goagle-input-full {
  width: 100%;
}

/* Button */
.goagle-button {
  border-radius: 4px;
  border: none;
  background: var(--goagle-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.goagle-button-full {
  width: 100%;
  padding: 10px 16px;
  margin-top: 8px;
}

.goagle-button:hover {
  background: #185abc;
}

/* Row with checkbox and Need help? */
.goagle-login-footer-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.goagle-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--goagle-sub);
}

/* Links */
.goagle-link {
  font-size: 13px;
  color: var(--goagle-primary);
  text-decoration: none;
}

.goagle-link:hover {
  text-decoration: underline;
}

/* Link below the box */
.goagle-below-card-link {
  margin-top: 12px;
}

/* Email row inside register card */
.goagle-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Make the whole row match other full-width inputs */
.goagle-email-row,
.goagle-email-input {
  width: 100%;
}

.goagle-email-input {
  flex: 1 1 auto;
}

.goagle-email-domain {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--goagle-sub);
}

.goagle-honeypot {
  position: absolute;
  left: -9999px;
  visibility: hidden;
}

/* GoMail inbox layout */

.gomail-body {
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.gomail-root {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */

.gomail-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #dadce0;
  background: #f8f9fa;
}

.gomail-logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gomail-logo-icon {
  display: flex;
  align-items: center;
}

.gomail-logo-text {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
}

/* Search box square instead of pill */
.gomail-search-wrapper {
  flex: 0 0 420px;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #dadce0;
  padding: 4px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gomail-search-wrapper:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.gomail-search-clear {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9aa0a6;
  padding: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gomail-search-clear:hover {
  color: #5f6368;
}

.gomail-search-icon {
  margin-right: 6px;
  display: flex;
  align-items: center;
}

.gomail-search-input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: #202124;
}

.gomail-search-input::placeholder {
  color: #9aa0a6;
}

.gomail-user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gomail-user-email {
  font-size: 14px;
  color: #202124;
}

.gomail-mail-indicator {
  display: flex;
  align-items: center;
}

.gomail-mail-indicator-none {
  color: #9aa0a6;
}

.gomail-mail-indicator-new {
  color: #1a73e8;
}

.gomail-user-menu {
  position: relative;
  display: inline-block;
}

.gomail-user-avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.gomail-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gomail-user-menu-dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.3);
  padding: 4px 0;
  display: none; /* hidden by default */
  z-index: 10;
}

.gomail-user-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.gomail-user-menu-item:hover {
  background: #e8f0fe;
}

.gomail-user-menu-item-danger:hover {
  background: #fce8e6;
}

.gomail-user-menu-icon {
  display: flex;
  align-items: center;
}

.gomail-user-menu-text {
  flex: 1;
  text-align: left;
}

.gomail-user-menu-text-danger {
  color: #d93025; /* red logout text */
}

/* Main area */

.gomail-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Sidebar */

.gomail-sidebar {
  width: 220px;
  border-right: 1px solid #dadce0;
  padding: 16px 8px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.gomail-newmail-btn {
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #1a73e8, #16a085);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gomail-newmail-btn:hover {
  filter: brightness(1.05);
}

.gomail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gomail-nav-item {
  border: none;
  background: transparent;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #202124;
}

.gomail-nav-item:hover {
  background: #e8f0fe;
}

.gomail-nav-item-active {
  background: #fce8e6;
}

.gomail-nav-icon {
  display: flex;
  align-items: center;
}

/* Content: message list */

.gomail-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gomail-content-header {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #dadce0;
}

.gomail-refresh-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

@keyframes gomail-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.gomail-refresh-btn.spin {
  animation: gomail-spin 0.6s linear infinite;
}

.gomail-message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.gomail-row {
  display: grid;
  grid-template-columns: auto auto 2fr 6fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
}

.gomail-row:hover {
  background: #f5f5f5;
}

.gomail-row-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.gomail-row-star-btn {
  width: 24px;
}

.gomail-row-action-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.gomail-row-purge-btn {
  color: #9aa0a6;
}

.gomail-row-purge-btn:hover {
  color: #d93025;
}

.gomail-row-from {
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gomail-row-subject {
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gomail-row-date {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
}

.gomail-row-unread {
  font-weight: 600;  /* bold for unread */
  color: #202124;
}

/* Empty state */

.gomail-empty-state {
  padding: 24px 16px;
  color: #5f6368;
  font-size: 14px;
}

.gomail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.gomail-modal {
  background: #ffffff;
  border-radius: 0;  /* square corners */
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  max-width: 720px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.gomail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  border-bottom: none;
}

.gomail-modal-subject {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
  margin-right: 12px;
}

.gomail-modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.gomail-modal-close:hover {
  color: #202124;
}

.gomail-modal-from {
  padding: 8px 20px;
  font-size: 14px;
  color: #5f6368;
}

.gomail-modal-body-wrapper {
  padding: 12px 20px 20px;
  flex: 1;               /* take remaining height */
  overflow: auto;        /* enable scrolling inside */
}

.gomail-modal-body {
  margin: 0;
  padding: 12px 16px;        /* inner padding inside grey area */
  background: #f5f5f5;
  border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  font-size: 13px;
  color: #202124;
}

/* iframe used for HTML body */
.gomail-html-iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  display: block;
}

/* Compose panel */

.gomail-compose {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 500px;
  background: #ffffff;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 32px rgba(60, 64, 67, 0.28);
  display: flex;
  flex-direction: column;
  z-index: 200;
}

.gomail-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #e8edf5;
  border-radius: 8px 8px 0 0;
}

.gomail-compose-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--goagle-primary);
}

.gomail-compose-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.gomail-compose-close:hover {
  color: #202124;
}

.gomail-compose-field {
  display: flex;
  align-items: center;
  padding: 8px 14px;
}

.gomail-compose-field-icon {
  color: #9aa0a6;
  margin-right: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.gomail-compose-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #202124;
  background: transparent;
}

.gomail-compose-input::placeholder {
  color: #9aa0a6;
}

.gomail-compose-sep {
  height: 1px;
  background: #e0e0e0;
  margin: 0;
}

.gomail-compose-body {
  flex: 1;
  min-height: 240px;
  resize: none;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 14px;
  color: #202124;
  font-family: inherit;
}

.gomail-compose-body::placeholder {
  color: #9aa0a6;
}

.gomail-compose-footer {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #e0e0e0;
  gap: 8px;
}

.gomail-compose-send {
  border: none;
  border-radius: 16px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  background: #c5c5c5;
  color: #ffffff;
  cursor: not-allowed;
  transition: background 0.15s;
}

.gomail-compose-send:not(:disabled) {
  background: var(--goagle-primary);
  cursor: pointer;
}

.gomail-compose-send:not(:disabled):hover {
  background: #185abc;
}

.gomail-compose-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #5f6368;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gomail-compose-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gomail-compose-discard {
  margin-left: auto;
  font-size: 16px;
}

/* Account Settings modal */

.gomail-settings-modal {
  max-width: 480px;
}

.gomail-settings-body {
  padding: 0 20px 20px;
  overflow-y: auto;
}

.gomail-settings-section {
  padding: 16px 0;
}

.gomail-settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 12px;
}

.gomail-settings-title-danger {
  color: #d93025;
}

.gomail-settings-divider {
  height: 1px;
  background: #dadce0;
}

.gomail-settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gomail-settings-input {
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 14px;
  color: #202124;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gomail-settings-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.gomail-settings-input::placeholder {
  color: #9aa0a6;
}

.gomail-settings-message {
  font-size: 13px;
  padding: 6px 0;
}

.gomail-settings-message-error {
  color: #d93025;
}

.gomail-settings-message-success {
  color: #0d652d;
}

.gomail-settings-btn {
  align-self: flex-end;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  background: #1a73e8;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s;
}

.gomail-settings-btn:hover {
  background: #185abc;
}

.gomail-settings-btn:disabled {
  background: #c5c5c5;
  cursor: not-allowed;
}

.gomail-settings-btn-danger {
  background: #d93025;
}

.gomail-settings-btn-danger:hover:not(:disabled) {
  background: #b52116;
}

.gomail-settings-warning {
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 12px;
  line-height: 1.5;
}

.gomail-settings-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #202124;
  cursor: pointer;
  margin-bottom: 12px;
  line-height: 1.4;
}

.gomail-settings-confirm-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}