/**
 * Donor Signup Form Styles
 * Custom styles for the donor signup form
 */

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 12px;
}

.card-body {
    background-color: #ffffff;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Button Styling */
.btn-primary {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    transform: none;
    opacity: 0.65;
}

/* Tag Selection Styling */
.tag-selection {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.form-check {
    margin-bottom: 1rem;
    padding-left: 1.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    font-size: 1rem;
}

.form-check-label small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* ReCAPTCHA Styling */
.g-recaptcha {
    transform: scale(0.9);
    transform-origin: 0 0;
}

@media (min-width: 576px) {
    .g-recaptcha {
        transform: scale(1);
    }
}

/* Success/Error Screens */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.border-success {
    border: 2px solid #198754 !important;
}

.border-danger {
    border: 2px solid #dc3545 !important;
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Form Header */
#formHeader h1 {
    font-weight: 600;
    color: #212529;
}

#logoContainer img {
    display: block;
    /* Alignment is controlled by #logoContainer's flex justify-content (set in
       renderLogo per the configured logo position). A `margin: 0 auto` here would
       center the img as a flex item regardless of justify-content, breaking the
       Left/Right positions — so keep margins at 0. */
    margin: 0;
}

/* Help Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Required Indicator */
.text-danger {
    color: #dc3545;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .card-body {
        padding: 2rem 1.5rem !important;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    #formHeader h1 {
        font-size: 1.75rem;
    }
}

/* Form Group Spacing */
.form-group {
    margin-bottom: 1.5rem;
}

/* Section Headers */
h5 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
}

/* Smooth Transitions */
.form-control,
.form-select,
.btn {
    transition: all 0.2s ease-in-out;
}

/* Focus States */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: none;
}

/* Card Shadow */
.shadow-sm {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Success Icon Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fa-check-circle {
    animation: checkmark 0.5s ease-in-out;
}

/* Error Icon Animation */
@keyframes errormark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.fa-exclamation-circle {
    animation: errormark 0.5s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print Styles */
@media print {
    body {
        background-color: #ffffff;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6;
    }

    .btn {
        display: none;
    }
}

/* ── Form layout (driven by config: layoutColumns / layoutStyle) ─────────────
   Shared class names + CSS with the client-portal preview. Applied to
   #formFields by signup.js. */

/* Columns: 2-column field grid. Fields (.form-group) take half width; section
   headings (e.g. "Mailing Address") stay full width. */
#formFields.signup-cols-2 {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1rem;
}
#formFields.signup-cols-2 > * {
    flex: 1 1 100%;
}
#formFields.signup-cols-2 > .form-group {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
}
@media (max-width: 575.98px) {
    #formFields.signup-cols-2 > .form-group {
        flex-basis: 100%;
    }
}

/* Layout style: horizontal (rev1 parity) = ALL fields in one side-by-side row.
   The form CARD is the horizontal scroller and its body grows to the (wide) field
   row, so the whole form — the field row AND the submit button — scrolls together
   as one unit. Everything is reachable inside the single scroll. Vertical
   (stacked) is the default. */

/* The field row: one continuous nowrap row. Section headings (e.g. "Mailing
   Address") are hidden so the row stays continuous. */
#formFields.signup-horizontal {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    column-gap: 1rem;
}
#formFields.signup-horizontal > .form-group {
    flex: 0 0 220px;
    width: 220px;
    margin-bottom: 0;
}
#formFields.signup-horizontal > :not(.form-group) {
    display: none;
}

/* The card scrolls horizontally; its body is sized to the field-row width so the
   fields + button (all inside the card body) scroll together. */
#formCard.signup-hscroll {
    overflow-x: auto;
}
#formCard.signup-hscroll > .card-body {
    width: max-content;
    min-width: 100%;
}

/* Submit button: content-sized and left-aligned (not the full-width d-grid bar).
   Bootstrap's .d-grid is `display: grid !important`, which stretches the button. */
#formCard.signup-hscroll .d-grid {
    display: block !important;
}
#formCard.signup-hscroll .d-grid > .btn {
    width: auto;
    display: inline-block;
}
