/* ==========================================================================
   1. CORE GLOBAL STYLES & MIDNIGHT BLUE BACKGROUND
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #040814 0%, #060a14 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    align-items: center;
    overflow-x: hidden;
}

/* Page structural wrapper guaranteeing dynamic footer pushing separation */
main.form-wrapper {
    flex: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 90px 12px 30px 12px; /* Tight padding margins preventing mobile overflow stretching */
}

/* ==========================================================================
   2. SHRUNK SLIGHTLY TRANSPARENT GLASS CONTAINER
   ========================================================================== */
.registration-container {
    background-color: rgba(247, 244, 235, 0.94); 
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 480px; /* Highly optimized ultra-compact width constraint footprint */
    padding: 1.25rem;   
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border: 2px solid #FF7A00; /* Crisp iconic vibrant orange outline */
    
    /* Smooth Fluid Entrance Animation */
    animation: portalEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
}

@keyframes portalEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h2 {
    color: #0B132B;
    text-align: center;
    font-size: 1.15rem; 
    font-weight: 800;
    margin-bottom: 0.15rem;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.subtitle {
    color: #5C677D;
    text-align: center;
    font-size: 0.72rem;
    margin-bottom: 0.85rem; 
}

/* ==========================================================================
   4. FULLY RESPONSIVE DUAL-COLUMN GRID ENGINE
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 balanced columns layout on desktops/tablets */
    gap: 0.5rem 0.65rem;                   
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    color: #0B132B;
    font-size: 0.62rem; 
    margin-bottom: 0.15rem; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Low-Profile Field Controls */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.4rem 0.5rem; 
    background-color: #FAFAFA;
    border: 1.5px solid #E2DDD3;
    border-radius: 6px;
    color: #0B132B;
    font-size: 0.82rem; 
    outline: none;
    transition: all 0.2s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #FF7A00; 
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

textarea {
    min-height: 50px; 
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='none' stroke='%230B132B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.7rem;
    padding-right: 1.5rem;
}

input[type="file"] {
    background-color: #FAFAFA;
    border: 1.5px dashed #E2DDD3;
    padding: 0.35rem; 
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    width: 100%;
}

input[type="file"]:hover {
    border-color: #FF7A00;
    background-color: rgba(255, 122, 0, 0.02);
}

/* ==========================================================================
   5. ANTI-OVERLAP & STRETCH TERMS CONSOLE BOX ENGINE (MOBILE SAFE)
   ========================================================================== */
.checkbox-group {
    display: block; /* Forced block wrapping container element flow to stop desktop stretching alignment bugs */
    width: 100%;
    margin-top: 0.25rem;
}

.checkbox-group input[type="checkbox"] {
    float: left; /* Floats the box cleanly to the left margins */
    width: 1rem;
    height: 1rem;
    accent-color: #FF7A00;
    cursor: pointer;
    margin-right: 0.5rem; /* Forces a fixed clearance gutter gap separating the adjacent text */
    margin-top: 2px;
}

.checkbox-group label {
    display: block; /* Allows natural typographic line wrapping behavior text engine flows */
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    color: #5C677D;
    font-weight: 500;
    line-height: 1.35;
    font-size: 0.68rem; /* Highly legible compact micro-copy */
    margin-bottom: 0;
    word-break: normal;
    white-space: normal; /* COMPLETELY CRITICAL: Forces full multiline word breaks on smartphones */
}

/* ==========================================================================
   6. BUTTONS & ACTIONS
   ========================================================================== */
/* ==========================================================================
   5. BUTTON LOADER MECHANICS
   ========================================================================== */
/* ==========================================================================
   5. BUTTONS & INTERACTIVE ACTIONS (FIXED PROPORTIONS)
   ========================================================================== */
.btn-submit {
    margin-top: 0.6rem; 
    width: 100%;
    background-color: #FF7A00; /* Vibrant Orange Fill */
    color: #FFFFFF;
    border: none;
    padding: 0.55rem; 
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    
    /* FIXED: Flex layout alignment forced inside block container button tracks */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background-color: #E06B00; /* Darkened Hover Orange */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.2);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* The loading spinner crescent element layout rules */
.button-loader {
    width: 14px;
    height: 14px;
    border: 2px solid #FFFFFF;
    border-bottom-color: transparent; /* Creates the spinning wedge shape */
    border-radius: 50%;
    display: inline-block;
    animation: rotationSpinner 0.6s linear infinite;
    flex-shrink: 0; /* Prevents button sizing compression glitches */
}

@keyframes rotationSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ==========================================================================
   6. HIGH CONTRAST STATUS ALERTS (ENFORCED SOLID RED & GREEN)
   ========================================================================== */
.alert {
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700; /* Bolder text weight for high legibility */
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: portalEntrance 0.3s ease-out forwards;
}

/* SUCCESS: Crisp High-Contrast Green Border & Background theme */
.alert.success { 
    background-color: #DCFCE7; /* Pale green fill window */
    color: #16A34A;            /* Solid crisp Green text asset color mapping */
    border: 1.5px solid #16A34A; 
}

/* ERROR: Crisp High-Contrast Red Border & Background theme */
.alert.error { 
    background-color: #FEE2E2;   /* Pale red fill window */
    color: #DC2626;              /* Solid crisp Red text asset color mapping */
    border: 1.5px solid #DC2626; 
}

.hidden { 
    display: none !important; 
}

/* ==========================================================================
   7. STACKING OVERRIDES FOR SMARTPHONES & TOUCH DEVICE VIEWPORTS
   ========================================================================== */
@media (max-width: 520px) {
    main.form-wrapper {
        padding-top: 85px; /* Saves row space below header layout maps */
    }
    
    .registration-container {
        padding: 1rem; /* Condenses inside padding grids securely to prevent device horizontal stretching clip cuts */
    }

    .form-grid {
        grid-template-columns: 1fr; /* Force 100% full wide stacked inputs array rows on cellphones */
        gap: 0.6rem;
    }
    
    .form-group {
        grid-column: span 1 !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 0.9rem; /* Prevents iOS mobile browser engine auto zoom triggers on touch execution points */
    }
}/* ==========================================================================
   MODERN PREMIUM PORTRAIT DROPZONE UPLOAD FIELD
   ========================================================================== */
/* Hide the traditional, boring browser file input button completely */
input[type="file"]#profile_photo {
    display: none;
}

/* Create the premium, interactive custom upload card container box */
.custom-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(250, 250, 250, 0.7);
    border: 2px dashed #E2DDD3;
    border-radius: 8px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 0.2rem;
}

/* Hover effects with your official vibrant orange accent branding color */
.custom-file-upload:hover {
    border-color: #FF7A00;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.1);
}

/* Dragover interactive state handled smoothly via Javascript */
.custom-file-upload.dragover {
    border-color: #FF7A00;
    background-color: rgba(255, 122, 0, 0.05);
    transform: scale(0.99);
}

/* Icon layout typography features */
.upload-icon {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.upload-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0B132B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upload-hint {
    font-size: 0.65rem;
    color: #5C677D;
    margin-top: 0.15rem;
}

/* Success layout highlight state when an image file is queued or loaded */
.custom-file-upload.file-selected {
    border-color: #16a34a;
    background-color: rgba(22, 163, 74, 0.03);
}
.custom-file-upload.file-selected .upload-text {
    color: #16a34a;
}
/* ==========================================================================
   LIVE PREVIEW ARCHITECTURE
   ========================================================================== */
.upload-prompt-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: var(--transition);
}

/* Hidden helper class */
.upload-prompt-wrapper.hidden {
    display: none !important;
}

/* Premium Image Preview frame sizing */
.file-preview-img {
    width: 70px;
    height: 70px;
    object-fit: cover; /* Ensures clean aspect crop alignment inside the frame */
    border-radius: 50%; /* Rounded profile picture avatar style */
    border: 2px solid #FF7A00; /* Vibrant Orange accent framing border */
    box-shadow: 0 4px 10px rgba(255, 122, 0, 0.2);
    animation: previewFadeIn 0.3s ease-out forwards;
    display: block;
}

@keyframes previewFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
