/**
 * Grownex Volunteer Form — theme-aligned fallbacks when Tailwind/theme vars are absent.
 * Uses same tokens as theme: color-blue #4AA5D4, borders, rounded-xl, gn-btn.
 */

.grownex-volunteer-section {
    --gn-volunteer-blue: var(--color-blue, #4AA5D4);
    --gn-volunteer-blue-hover: var(--color-blue-dark, #2E88B9);
    --gn-volunteer-border: var(--color-border2, #e5e7eb);
    --gn-volunteer-text: var(--color-gray, #6b7280);
    --gn-volunteer-white: var(--color-white, #ffffff);
}

.grownex-volunteer-intro {
    color: var(--gn-volunteer-text);
}

.grownex-volunteer-form .grownex-volunteer-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--gn-volunteer-border);
    border-radius: 0.75rem;
    background: var(--gn-volunteer-white, #fff);
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.grownex-volunteer-form .grownex-volunteer-input:focus {
    outline: none;
    border-color: var(--gn-volunteer-blue);
    box-shadow: 0 0 0 3px rgba(74, 165, 212, 0.2);
}

.grownex-volunteer-form label {
    color: inherit;
}

/* Custom checkboxes — matches theme volunteer template */
.grownex-volunteer-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 4px;
    background: var(--gn-volunteer-white, #fff);
    border: 1px solid var(--color-border, #d1d5db);
    box-shadow: 0 4px 2px 0 rgba(0, 0, 0, 0.02), 0 2px 2px 0 rgba(0, 0, 0, 0.03);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.grownex-volunteer-checkbox:checked {
    background: var(--gn-volunteer-blue);
    border-color: var(--gn-volunteer-blue);
}

.grownex-volunteer-checkbox:checked::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: -1px;
    color: var(--gn-volunteer-white, #fff);
    font-size: 0.875rem;
    line-height: 1;
}

.grownex-volunteer-radios input[type="radio"] {
    accent-color: var(--gn-volunteer-blue);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Plain field labels (First Name, Email, Gender, Availability, etc.) --
 * bare <label> tags, excluded from the base RTL rule (main.css) same as
 * every other bare label on the site -- never had text-align, so they
 * defaulted to left. Matched on the exact shared class string since
 * `.block`/`.text-sm`/`.font-medium` alone are too generic to scope to. */
label.block.mb-1.text-sm.font-medium,
label.block.mb-3.text-sm.font-medium {
    text-align: right;
}

/* RTL text-readiness: radio/checkbox + label text rows render control after text */
.grownex-volunteer-radios label,
.grownex-volunteer-checkboxes label {
    flex-direction: row-reverse;
}

.grownex-volunteer-submit,
.grownex-volunteer-form .grownex-volunteer-submit.gn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: auto;
    width: auto;
    max-width: 100%;
    padding: 0.75rem 4rem !important;
    background-color: #DA273A !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 767px) {
    .grownex-volunteer-submit,
    .grownex-volunteer-form .grownex-volunteer-submit.gn-btn {
        width: 100%;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

.grownex-volunteer-submit:hover:not(:disabled),
.grownex-volunteer-form .grownex-volunteer-submit.gn-btn:hover:not(:disabled) {
    background-color: #b81f30 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(218, 39, 58, 0.25);
}

.grownex-volunteer-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.grownex-volunteer-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.grownex-volunteer-error {
    color: #b00020;
    background: #ffe6e6;
    border: 1px solid #b00020;
}

/* Success modal */
.grownex-volunteer-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.grownex-volunteer-modal[hidden] {
    display: none !important;
}

.grownex-volunteer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.grownex-volunteer-modal-panel {
    position: relative;
    background: #fff;
    max-width: 28rem;
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    text-align: center;
}

.grownex-volunteer-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
}

.grownex-volunteer-modal-close:hover {
    color: #4b5563;
}

.grownex-volunteer-modal-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grownex-volunteer-modal-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.grownex-volunteer-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.grownex-volunteer-modal-text {
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Grid helpers when theme Tailwind grid is missing */
.grownex-volunteer-form-inner.space-y-10 > * + * {
    margin-top: 2.5rem;
}

@media (min-width: 768px) {
    .grownex-volunteer-form .grid.md\:grid-cols-2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.grownex-volunteer-form .grid {
    display: grid;
    gap: 1rem;
}

.grownex-volunteer-checkboxes.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .grownex-volunteer-checkboxes.sm\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.grownex-volunteer-form .flex {
    display: flex;
}

.grownex-volunteer-form .flex-wrap {
    flex-wrap: wrap;
}

.grownex-volunteer-form .gap-4 {
    gap: 1rem;
}

.grownex-volunteer-form .justify-center {
    justify-content: center;
}

.grownex-volunteer-form .mt-8 {
    margin-top: 2rem;
}
