/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

html, body {
  margin: 0;
  border: 0;
  padding: 0;
  background: white;
  color: black;
}

 html {
   font-size: 16px;
 }

 body {
  font-family: sans-serif;
  padding: 1.2rem;
  line-height: 1.35;
}

body#intake_form {
  margin: 0 auto;
  max-width: 900px;
}

a {
  color: #68b04d;
  font-weight: bold;
  text-decoration: underline;
}

a:hover {
  color: black;
}
body, input, textarea, button:not([class*="trix"]), label, select {
  font-size: 1rem;
}

input[type="tel"] {
  font-size: 0.9rem;  /* Slightly smaller to compensate for monospace */
  width: 19ch;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
input[type="number"],
textarea,
select {
  padding:  0.5rem;
  margin:  0.6rem 0 0.1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.3s;
}

input[type="number"] {
  padding: 0.3rem 0 0.3rem 0.3rem;
}

input[type="text"]:not([size]),
input[type="email"]:not([size]),
input[type="url"]:not([size]),
input[type="password"]:not([size]),
input[type="search"]:not([size]),
textarea {
  width: 100%;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: #25710e;
  outline: none;
}

.char-counter {
  color: #666;
  text-align: right;
  margin-top: 4px;
}

.char-counter.warn {
  color: #c00;
}

nav.tab-bar a, button:not([class*="trix"]), input[type="submit"], .link-button {
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  background-color: #68b04d;
  min-width: 8rem;
  color: black;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  padding: .8rem 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:has(svg) {
  min-width: auto !important;
}

input[type="submit"], .link-button {
  background: #005300;
  font-weight: 700;
  color: white;
}

button:disabled, input[type="submit"]:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  background-color: #85bf6d;
}

form button:not(:disabled):hover {
  border: 1px solid #48902f;
}

input[type="submit"]:not(:disabled):hover, .link-button:hover {
  background-color: #002a00;
  color: white;
}

form button.clear-btn {
  background: #f4f9f1;
  color: #294b24;
  margin-left: auto;
  border: 1px solid #cae2bd;
}

form button.clear-btn:hover {
  border-color: #c11e00;
  background: #ff8454;
  color: white;
}

.navigation {
  display: flex;
  flex-wrap: wrap;
  row-gap: 2rem;
  column-gap: 0.6rem;
}

body#intake_form form {
  container-type: inline-size;
  margin-bottom: 4rem;
}

@container (max-width: 480px) {
  .navigation {
    justify-content: center;
  }
  button.clear-btn {
    margin-left: 0;
  }
}

input[type="radio"] {
  margin: 5px;
  cursor: pointer;
}

label small {
  color: #939393;
  font-size: 0.9em;
}

input[type="tel"] {
  font-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace;
}

[data-controller="pena"] input[type="number"] {
  width: 4em;
}

[data-controller="pena"] input[type="number"]:not(:placeholder-shown) {
  text-align: right;
}

label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: flex-start;
}

input[type="radio"],
input[type="checkbox"] {
  margin-top: 0.25em;
  margin-right: 0.5em;
}

label:has(input[type="radio"]):not(:last-of-type) {
  margin-right: 1.5rem;
}

input:disabled {
  opacity: 0.35;
}

legend {
    display: table;
    float: left;
    padding: 0;
    margin-bottom: 0.5em;
    width: 100%;
}

legend + * {
  clear: both;
}

fieldset {
  border: none;
}

.field-container {
   background-color: #f5f5f5;
   margin: 1rem 0;
   padding: 0.7rem;
   border-radius: 8px;
   border: 1px solid #e0e0e0;
}

.field-container.admin {
  background-color: #e4cdea;
  border-color: #c79dd4;
}

.field-container.error {
  background-color: #fff0f0;
  border-color: #ffcdd2;
}

.field-container.error input,
.field-container.error textarea,
.field-container.error select {
   border-color: #ef5350;
}

.field-container.error .error-message {
   color: #d32f2f;
   font-size: 0.9em;
}

.repeat-sender-notice {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.repeat-sender-notice p {
  margin: 0
}

.process-numbers-list {
  margin: .5rem 4px 0;
  line-height: 1.6;
  font-size: .9rem;
}

.process-numbers-list .process-number {
  margin: 2px 0 2px 6px;
}

.process-numbers-list .process-number .mono { font-family: ui-monospace, Menlo, monospace; }
.process-numbers-list .process-number .status { color: #333; }

.process-numbers-list .process-number.incomplete b { color: #777; }
.process-numbers-list .process-number.valid      b { color: #2d7a4f; }
.process-numbers-list .process-number.invalid    b { color: #dc2626; }


.debug {
  border: 3px dashed #ff6b6b;
  background-color: #f9f9f9;
  border-radius: 4px;
  font-family: monospace;
  font-size: 1.2rem;
  color: #333;
  overflow-x: auto;
  width: 400px;
  text-align: center;
  position: absolute;
  top: 1rem;
  right: 1rem;
  max-height: 1.5rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  opacity: 0.3;
  transition: max-height 70ms ease-out, padding 50ms ease-out, opacity 150ms ease-out;
}

.debug:hover {
  opacity: 1;
  padding: 3px 1rem;
  max-height: 1000px;
  transition: max-height 70ms ease-out, padding 50ms ease-in, opacity 150ms ease-in;
}

.debug a {
  background-color: #ff6b6b;
  color: white;
  padding: .5rem .9rem;
  border-radius: 3px;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.debug a:hover {
  background-color: #ff4757;
}


.tableview {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.9rem;
  width: 100%;
}

.pill {
  display: inline-block;
  padding: 0 5px;
  border-radius: 8px;
}

.grad {
  padding-left: 3px;
  border-left: 6px solid black;
}

.tableview td {
  white-space:      nowrap;
  overflow:         hidden;
  text-overflow:    ellipsis;
  max-width:        180px;
  padding: 2px 4px;
  color: #39443a;
  background: #f1f2f1;
}

.tableview tr:nth-child(even) td {
  background: #fafbfa;
}

.tableview th {
  text-align: left;
  padding: 4px;
}

.tableview th a {
  color: #2b3c2c;
  text-decoration: none;
}

.tableview td a {
  color: #25710e;
  text-decoration: none;
}

.report-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.report h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.report-table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.9rem;
  border: 1px solid #ddd;
}

.report-table td,
.report-table th {
  background: #f5f5f5;
  padding: 2px 4px;
  text-align: left;
}

.report-table tr:nth-child(even) td,
.report-table tr:nth-child(even) th {
  background: #ebebeb;
}

.report-table td {
  max-width: 700px;
}

.report-table.long th {
  min-width: 300px;
}

.row-link {
  cursor: pointer;
}

.row-link .controls {
  cursor: initial;
}

.row-link td {
  transition: background-color 60ms;
}

.row-link:hover td {
  background-color: #e7f2e1 !important;
}

.auth h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 1rem 0 0.3rem;
  color: #333;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 2.4rem 0 0.5rem;
  color: #333;
}

nav.tab-bar {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  padding: 0 20px;
  border-bottom: 3px solid #48902f;
  margin-bottom: 1.1rem;
}

nav.tab-bar button,
nav.tab-bar a {
  padding: .6rem 1.2rem .4rem;
  border-radius: 4px 4px 0 0;
}

nav.tab-bar button.active:not(:disabled):hover,
nav.tab-bar a.active:not(:disabled):hover {
  background-color: #68b04d;
}

nav.tab-bar button:not(.active),
nav.tab-bar a:not(.active) {
  background: #d7eacd
}

nav.tab-bar button:not(.active):hover,
nav.tab-bar a:not(.active):hover {
  transition: transform 90ms ease-in-out;
  transform: scale(1.03, 1.06);
  transform-origin: bottom center;
}

.tab-badge {
  display:          inline-block;
  min-width:        22px;
  height:           18px;
  border-radius:    10px;
  background-color: #b8d4a8;
  color:            #2d4a24;
  text-align:       center;
  line-height:      18px;
  font-size:        11px;
  font-weight:      600;
  margin-left:      6px;
  padding:          0 4px;
  box-sizing:       border-box;
  transition:       background-color 0.2s;
  vertical-align:   middle;
}

nav.tab-bar button.active .tab-badge {
  background-color: #9cc485;
  color:            #1a2e15;
}

nav.tab-bar button:hover .tab-badge {
  background-color: #a3d190;
}

nav.tab-bar button.active:hover .tab-badge {
  background-color: #85b86d;
}

[role="tooltip"] {
  cursor: help;
  position: relative;
}

[role="tooltip"]::after {
  content: attr(aria-label);
  position: absolute;
  left: 20px;
  top: 120%;
  min-width: 250px;
  max-width: 400px;
  padding: 8px 12px;
  background: rgba(0, 33, 0, 0.9);
  color: white;
  font-size: 0.875rem;
  font-weight: normal;
  line-height: 1.4;
  white-space: pre-wrap;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.5s;
}

[role="tooltip"]:hover::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.controls-wrapper {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
}

.comment-form {
  margin-bottom: 1rem;
}

.comment-form, .comment {
  max-width: 900px;
}

.comment-instructions {
  color: #999;
  font-size: .85rem;
  flex: 1;
  margin: 0;
  padding-left: 1rem;
}
.comment-instructions p {
  margin: 0.2rem 0 0 0;
}

.event {
  color: #777777;
  font-size: 0.82rem;
  margin: 0.3rem 0;
}

.event b {
  font-weight: normal;
  color: #444;
}

.comment {
  font-size: 0.94rem;
  background: #f5f5f5;
  padding: 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.comment p {
  margin: 0;
}

.comment p + p {
  margin-top: 0.6rem;
}

button.small {
  padding: 5px 10px;
  font-size: .95rem;
  border: 1px solid transparent;
}

button.danger,
.link-button.danger {
  border-color: transparent;
  background: #ff8454;
  color: white;
}

button.danger:hover,
.link-button.danger:hover {
  background: #ff6434;
  border-color: #c11e00 !important;
}

#users-table tr:hover td {
  background: #e7f2e1 !important;
}

.tiny-button {
  min-width: auto !important;
  padding: 2px 4px !important;
  font-size: 1rem !important;
  margin: 0 !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
}

.tiny-button:hover {
  border: 1px solid #002f00 !important;
  background-color: #68b04d !important;
}

@property --angle {
  syntax        : "<angle>";
  initial-value : 0deg;
  inherits      : false;
}

.danger-mode {
  padding: 8px;
  margin-right: 0.6em;
  border-radius: 50%;
}

.siren {
  text-shadow: -1px -1px 0 rgba(255, 255, 255, 0.5),
                1px -1px 0 rgba(255, 255, 255, 0.5),
               -1px  1px 0 rgba(255, 255, 255, 0.5),
                1px  1px 0 rgba(255, 255, 255, 0.5);

  background: conic-gradient(from var(--angle), #dc143c, #ff6b6b, #ff4500, #6a5acd, #ff6347, #ff1493, #b22222, #7b68ee, #dc143c, #ff6b6b, #ff4500, #9370db, #dc143c);
  animation : spin 5s linear infinite;
}

@keyframes spin {
  to { --angle: 360deg; }
}
