/*
  All styles are scoped under .tiiny-upload / .tu-* so the bundle can be dropped
  onto any static page without leaking into (or depending on) the host's CSS.
  Visuals mirror the homepage uploader (App.css, Home.css, StyledDropzone).
*/

.tiiny-upload {
  --tu-primary: #0d6efd;
  --tu-primary-dark: #0a58ca;
  --tu-purple: #ae5dd7;
  --tu-dropzone-border: #dc9bff;
  --tu-grey: #868686;
  --tu-light-grey: #bdbdbd;
  --tu-error: #dc3545;

  font-size: 16px;
  line-height: 1.5;
  color: #212529;
  text-align: center;
}

.tiiny-upload *,
.tiiny-upload *::before,
.tiiny-upload *::after {
  box-sizing: border-box;
}

.tiiny-upload h3,
.tiiny-upload h4,
.tiiny-upload h5 {
  margin: 0 0 8px;
  font-weight: 500;
  line-height: 1.2;
}

.tiiny-upload h3 { font-size: 28px; }
.tiiny-upload h4 { font-size: 24px; }
.tiiny-upload h5 { font-size: 20px; }

/* ---------- utilities ---------- */

.tu-flex { display: flex; }
.tu-center { justify-content: center; align-items: center; }
.tu-flex-1 { flex: 1; }
.tu-flex-2 { flex: 2; }
.tu-text-end { text-align: right; }
.tu-grey { color: var(--tu-grey); }
.tu-small { font-size: 13px; }
.tu-mt-2 { margin-top: 8px; }
.tu-mt-3 { margin-top: 16px; }
.tu-mt-4 { margin-top: 24px; }
.tu-mt-5 { margin-top: 48px; }
.tu-mb-2 { margin-bottom: 8px; }
.tu-my-4 { margin-top: 24px; margin-bottom: 24px; }
.tu-ms-2 { margin-left: 8px; }
.tu-link { cursor: pointer; }

/* ---------- buttons & inputs ---------- */

.tu-btn {
  display: inline-block;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.tu-btn:disabled { opacity: 0.65; cursor: default; }

.tu-btn-primary {
  color: #fff;
  background: var(--tu-primary);
  border-color: var(--tu-primary);
}

.tu-btn-primary:hover { background: var(--tu-primary-dark); }

.tu-btn-outline {
  color: var(--tu-primary);
  border-color: var(--tu-primary);
}

.tu-btn-outline:hover {
  color: #fff;
  background: var(--tu-primary);
}

.tu-btn-sm { font-size: 14px; padding: 4px 8px; }
.tu-btn-block { display: block; width: 100%; }

.tu-btn-purple {
  color: #fff;
  border: none;
  background: linear-gradient(90deg, #ae5dd7 0%, #0d6efd 20%, #ae5dd7 40%, #0d6efd 60%, #ae5dd7 80%, #0d6efd 100%);
  background-size: 400% 100%;
  background-position: 0% 50%;
}

.tu-btn-purple:hover {
  color: #fff;
  background: linear-gradient(90deg, #8a4bb5 0%, #0851c7 20%, #8a4bb5 40%, #0851c7 60%, #8a4bb5 80%, #0851c7 100%);
  background-size: 400% 100%;
}

.tu-input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 6px 12px;
  color: #212529;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 6px;
  outline: none;
}

.tu-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

.tu-validation-error {
  text-align: left;
  color: red;
  padding: 5px;
  font-size: 14px;
}

/* ---------- dotted upload box ---------- */

.tu-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 65px 45px;
  border: 3px dashed var(--tu-dropzone-border);
  border-radius: 18px;
  background-color: #fafafa;
  color: var(--tu-light-grey);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border 0.24s ease-in-out;
}

.tu-dropzone:focus-visible,
.tu-dropzone--active {
  border-color: #2196f3;
}

.tu-icon {
  height: 40px;
  width: 50px;
  padding: 5px;
  object-fit: contain;
  opacity: 0.4;
}

.tu-icon:hover { opacity: 1; }

.tu-divider {
  height: 40px;
  margin: 0 8px;
  border-left: 1px solid #cbcbcb;
}

.tu-upload-btn {
  display: block;
  width: 200px;
  margin-top: 16px;
  padding: 8px 48px;
  font-weight: 700;
}

/* ---------- full page drop overlay ---------- */

.tu-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(17, 153, 142, 0.85);
  pointer-events: none;
}

.tu-page-overlay p {
  margin: 0;
  color: #fff;
  font-weight: bolder;
  word-spacing: 3px;
  font-size: 35px;
}

/* ---------- selected files ---------- */

.tu-file-list-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.tu-selected-file {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  background-color: #fafafa;
}

.tu-selected-file-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.tu-selected-file-name {
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 0;
  text-align: left;
}

.tu-file-icon {
  height: 30px;
  margin-right: 10px;
  opacity: 0.8;
}

.tu-truncate-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tu-truncate {
  display: block;
  width: 100%;
  font-size: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tu-file-size {
  margin-top: -4px;
  font-size: 13px;
  color: grey;
}

.tu-hint {
  margin-top: 8px;
  font-size: 13px;
  color: grey;
}

.tu-index-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tu-index-badge img { height: 16px; width: 16px; }

.tu-index-badge span {
  padding: 6px 12px;
  background: #d4edda;
  color: #155724;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tu-set-index-btn {
  margin: 0 16px 0 8px;
  padding: 6px 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tu-set-index-btn:hover {
  background: var(--tu-primary);
  color: #fff;
  border-color: var(--tu-primary);
}

.tu-remove-btn {
  margin-left: 16px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
}

.tu-add-more { margin: 8px 0 16px; }

/* ---------- email verify ---------- */

.tu-verify-heading {
  margin: 8px 0 16px;
}

.tu-verify-heading-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--tu-purple);
}

.tu-social {
  display: flex;
  gap: 8px;
}

.tu-social-btn {
  flex: 1;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dee2e6;
  background: #fff;
}

.tu-social-btn:hover { background: #f5f8ff; border-color: var(--tu-primary); }
.tu-social-btn img { height: 24px; margin: auto; }

.tu-separator {
  display: flex;
  align-items: center;
  width: 50%;
  margin: 16px auto 0;
  font-size: 12px;
  color: var(--tu-grey);
}

.tu-separator::before,
.tu-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #bfbfbf;
}

.tu-separator::before { margin-right: 0.25em; }
.tu-separator::after { margin-left: 0.25em; }

.tu-email-row { margin-top: 16px; align-items: flex-start; }

/* ---------- success / verify stage ---------- */

.tu-success-box {
  position: relative;
  padding: 10px;
}

.tu-exit {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 10px;
  font-size: 24px;
  line-height: 1;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
}

.tu-domain {
  overflow-wrap: break-word;
  font-size: 28px;
  margin: 0 12px;
}

.tu-success-icon circle { fill: #28a745; }
.tu-success-icon path {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tu-verify-panel {
  margin-top: 32px;
  padding: 24px;
  border-radius: 16px;
  background: #f5f5f5;
}

.tu-verify-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
}

.tu-verify-subtitle { font-size: 18px; }

.tu-resend {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.tu-resend-label {
  margin-bottom: 8px;
  font-size: 14px;
  color: #6c757d;
}

.tu-otp-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.tu-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease;
}

.tu-otp-input:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.15);
}

.tu-otp-input-error { border-color: var(--tu-error); }

.tu-otp-error {
  color: var(--tu-error);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- loading / error ---------- */

.tu-loading-box { padding: 50px; }

.tu-error-box { padding: 20px; }

.tu-error-icon {
  opacity: 0.7;
  margin-bottom: 20px;
}

.tu-error-box h5 { margin-bottom: 24px; }

.tu-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tu-spin 0.75s linear infinite;
}

.tu-spinner-sm { width: 16px; height: 16px; border-width: 2px; }

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

/* ---------- modal ---------- */

.tu-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
}

.tu-modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 0;
  background: #fff;
  border-radius: 12px;
  text-align: left;
}

.tu-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 28px;
  line-height: 1;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
}

.tu-file-list-modal h4,
.tu-file-list-modal > .tu-grey {
  margin-left: 24px;
  margin-right: 40px;
}

.tu-file-list { margin-top: 16px; }

.tu-file-list-item {
  display: block;
  width: 100%;
  padding: 3px 16px;
  font: inherit;
  text-align: left;
  border: none;
  cursor: pointer;
  background: #f3f3f3;
}

.tu-file-list-item:nth-child(even) { background: #e9e9e9; }

.tu-file-list-item:hover {
  color: #fff;
  background: #007bff;
}

.tu-upgrade-modal { padding: 0 24px; text-align: center; }
.tu-upgrade-modal p { color: #555; }

/* ---------- recaptcha ---------- */

.tu-recaptcha-terms {
  margin: 8px auto 0;
  max-width: 600px;
  color: #b5b5b5;
  font-size: 12px;
}

.tu-recaptcha-terms a {
  color: inherit;
  text-decoration: underline;
}

/* The terms text above is shown instead, as on the homepage */
.grecaptcha-badge {
  visibility: hidden;
}

/* ---------- mobile ---------- */

@media (max-width: 768px) {
  .tu-dropzone { padding: 45px 20px; }
  .tu-selected-file { padding: 16px; }
  .tu-set-index-btn { padding: 4px 8px; font-size: 11px; }
  .tu-index-badge span { padding: 4px 8px; font-size: 11px; }
  .tu-separator { width: 80%; }
}

@media (max-width: 480px) {
  .tu-otp-container { gap: 8px; }
  .tu-otp-input { width: 42px; height: 48px; font-size: 20px; }
}

