{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block title %}Register | {{ site_settings.site_name }}{% endblock %}

{% block content %}
<section class="relative pt-16 pb-12 lg:pt-24 lg:pb-20 overflow-hidden bg-slate-900 text-white border-b border-slate-800">
    {% if registration_settings.hero_background %}
    <div class="absolute inset-0 z-0">
        <img src="{{ registration_settings.hero_background.url }}" alt="Hero Background" class="w-full h-full object-cover" style="opacity: {{ registration_settings.hero_opacity_percentage|default:20 }}%;">
    </div>
    {% else %}
    <div class="absolute inset-0 overflow-hidden opacity-30 z-0">
        <div class="absolute top-0 right-0 w-[800px] h-[800px] rounded-full bg-indigo-600 blur-[120px] mix-blend-screen opacity-40"></div>
        <div class="absolute bottom-0 left-0 w-[600px] h-[600px] rounded-full bg-blue-500 blur-[100px] mix-blend-screen opacity-30"></div>
    </div>
    {% endif %}
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10 text-center">
        <span class="inline-block py-1 px-3 rounded-full bg-indigo-500/20 border border-indigo-500/30 text-indigo-300 text-sm font-semibold uppercase tracking-widest mb-4" data-aos="fade-down">Partner Registration</span>
        {% if registration_settings.hero_headline %}
        <h1 class="text-3xl md:text-4xl font-extrabold mb-4 tracking-tight text-white" data-aos="fade-up" data-aos-delay="100">{{ registration_settings.hero_headline }}</h1>
        {% endif %}
        {% if registration_settings.hero_subtext %}
        <p class="text-lg text-slate-300 max-w-2xl mx-auto font-light leading-relaxed" data-aos="fade-up" data-aos-delay="100">{{ registration_settings.hero_subtext }}</p>
        {% endif %}
    </div>
</section>

<section class="min-h-[65vh] flex flex-col justify-center items-center py-12 bg-slate-50 relative z-0">
    <div class="max-w-2xl w-full mx-auto px-4 sm:px-6 lg:px-8">
        


        <div class="bg-white p-6 md:p-7 rounded-2xl shadow-2xl shadow-slate-200/50 border-2 border-indigo-900 relative z-10 overflow-hidden" data-aos="fade-up">
            <div class="text-center mb-6">
                <h2 class="text-xl lg:text-2xl font-extrabold text-slate-900 mb-2 tracking-tight">Join Our Network</h2>
                <div class="h-1 w-12 bg-indigo-500 rounded-full mx-auto mb-3"></div>
                <p class="text-slate-500 text-sm">Register to partner with Trade California International.</p>
            </div>
            <div class="px-1 pb-1">
                {% crispy form %}
            </div>
        </div>
    </div>
</section>

<!-- Tom Select for modern dropdowns -->
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/css/tom-select.css" rel="stylesheet">
<style>
    /* Custom Tailwind tweaks for Tom Select to match the other fields */
    .ts-wrapper {
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .ts-control {
        border: 1px solid #cbd5e1 !important;
        border-radius: 0.375rem !important;
        padding: 0.5rem 0.75rem !important;
        box-shadow: none !important;
        background-color: #f8fafc !important;
        font-size: 0.875rem !important;
        min-height: 38px;
        display: flex;
        align-items: center;
    }
    .ts-control.focus {
        border-color: #6366f1 !important;
        background-color: #ffffff !important;
        box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
    }
    .ts-dropdown {
        border-radius: 0.375rem !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
        font-size: 0.875rem !important;
        padding: 0.25rem 0 !important;
    }
    .ts-dropdown .option {
        padding: 0.5rem 1rem !important;
    }
    .ts-dropdown .option:hover, .ts-dropdown .option.active {
        background-color: #eef2ff !important;
        color: #4f46e5 !important;
    }
</style>
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/js/tom-select.complete.min.js"></script>
<script>
    document.addEventListener("DOMContentLoaded", function() {
        const roleSelect = document.getElementById("id_role");
        if (roleSelect) {
            new TomSelect(roleSelect, {
                create: false,
                placeholder: "Select your role...",
            });
        }
    });
</script>
{% endblock %}
