/* ═══════════════════════════════════════════════════════════════════════
   forms.css  —  Single source of truth for all form and button styles.
   Depends on CSS custom properties defined in main.css (:root { … }).
   Loaded by both bases/public.html and bases/private.html.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── BUTTONS ──────────────────────────────────────────────────────────── */

/* Self-contained primary button — used standalone on landing/public pages
   and also with .btn for app forms (where .btn resets padding to 9px 18px
   since it is declared after this rule and wins on same-specificity). */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    background: var(--accent);
    color: #06101A;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 0 20px rgba(0, 194, 212, 0.3);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
    background: #00D8EC;
    box-shadow: 0 0 28px rgba(0, 194, 212, 0.4);
    transform: translateY(-1px);
}

/* Outline variant — landing pages only */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    color: var(--text-1);
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 50px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
    transform: translateY(-1px);
}

/* App button base — declared after .btn-primary so its padding (9px 18px)
   takes precedence when both classes are on the same element. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-1);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-link {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
}
.btn-link:hover { color: var(--text-1); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 0.75rem; }

/* ── FORM LAYOUT ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label,
.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-check label { margin-bottom: 0; color: var(--text-2); }

/* ── CORE INPUT / SELECT / TEXTAREA ──────────────────────────────────── */
.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-3);
    -webkit-text-fill-color: var(--text-3);
    font-size: 0.92rem;
    padding: 10px 14px;
    line-height: 1.5;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
    caret-color: var(--accent);
}
.form-control:focus {
    outline: none;
    border-color: rgba(0, 194, 212, 0.5);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-1);
    -webkit-text-fill-color: var(--text-1);
}
.form-control::placeholder {
    color: var(--text-2);
    -webkit-text-fill-color: var(--text-3);
    opacity: 1;
}
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0d1a1d inset;
    -webkit-text-fill-color: var(--text-1);
    caret-color: var(--text-1);
}

/* Select — custom SVG chevron, removes native OS arrow */
select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8B3C4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    color: var(--text-3);                      /* ← add this */
    -webkit-text-fill-color: var(--text-3); 
}

select.form-control option {
    color: var(--text-3);  /* text color of each option item */
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 96px;
}

/* Readonly / disabled */
.form-control[readonly],
.form-control:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--text-2);
    -webkit-text-fill-color: var(--text-2);
}

/* File inputs */
.form-control-file { font-size: 0.88rem; color: var(--text-2); }

/* ── ERROR MESSAGES ───────────────────────────────────────────────────── */
.error {
    font-size: 0.82rem;
    color: #f87171;
    display: block;
    margin-top: 4px;
}

/* ── AUTH PAGE INPUTS ─────────────────────────────────────────────────── */
/* Used by login.html, signup.html, complete_profile.html                 */
.auth-input {
    width: 100%;
    background: rgba(17, 180, 212, 0.05) !important;
    border: 1px solid rgba(17, 180, 212, 0.2) !important;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    font-size: 0.92rem;
    font-family: inherit;
    caret-color: var(--accent);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder {
    color: #64748b;
    -webkit-text-fill-color: #64748b;
    opacity: 1;
}
.auth-input:focus {
    border-color: transparent !important;
    box-shadow: 0 0 0 2px rgba(17, 180, 212, 0.4);
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #111827 inset, 0 0 0 2px rgba(17, 180, 212, 0.4);
    -webkit-text-fill-color: var(--text-1);
    caret-color: var(--text-1);
}

/* Social sign-in buttons (Google, Apple, etc.) */
.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(17, 180, 212, 0.2);
    background: rgba(17, 180, 212, 0.05);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    color: #cbd5e1;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.auth-social-btn:hover { background: rgba(17, 180, 212, 0.1); }

/* Custom checkbox tick mark (login "remember me") */
.checkbox-custom:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* ── FORM COMPONENT MODIFIERS ─────────────────────────────────────────── */
.search-form { display: flex; gap: 10px; }
.search-form .form-control { flex: 1; }
