/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='7' fill='%23002FA7'/></svg>") 20 20, auto;
}

body {
    font-family: 'Karla', sans-serif;
    font-size: 20px;
    line-height: 1.4;
    color: #000;
    background: #fff;
    min-height: 100vh;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='7' fill='%23002FA7'/></svg>") 20 20, auto;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    html, body, * {
        cursor: auto;
    }
}

/* Container */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 96px 32px;
}

/* Typography */
h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 48px;
    display: inline-block;
    line-height: 1.1;
}

.glitch.hover-stop .glitch-text {
    color: #002FA7;
}

p {
    margin-bottom: 24px;
    max-width: 100%;
    user-select: none;
}

/* Ensure text is selectable where expected */
h1,
label,
span,
.promise {
    user-select: text;
    -webkit-user-select: text;
}

/* Cursor ring on hover targets */
.glitch:hover,
.join-trigger:hover,
.submit-btn:hover {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'><circle cx='32' cy='32' r='28' fill='none' stroke='%23002FA7' stroke-width='2'/></svg>") 32 32, auto;
}

html:active,
body:active {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><circle cx='24' cy='24' r='9' fill='%23000000'/></svg>") 24 24, auto;
}

/* Glitch Effect */
.glitch {
    display: inline-block;
    font-family: 'Karla', sans-serif;
}

.glitch-text {
    display: inline-block;
}

/* Join Trigger */
.join-trigger {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='7' fill='%23002FA7'/></svg>") 20 20, auto;
    display: inline;
    position: relative;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.join-trigger:hover {
    opacity: 0.7;
}

.join-trigger::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #000;
}

/* Promise text */
.promise {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Application Form */
.application-form {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.application-form.open {
    max-height: 1400px;
    opacity: 1;
    margin-top: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: inline;
    margin-bottom: 8px;
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    font-family: 'Karla', sans-serif;
    font-size: 16px;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    outline: none;
    transition: border-color 0.2s ease;
    cursor: text;
}

.form-group .input-short {
    display: block;
    margin-top: 8px;
    max-width: 220px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: #002FA7;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Smart People List */
.smart-people {
    margin-top: 8px;
}

.smart-person {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.smart-person span {
    min-width: 20px;
}

.smart-person input {
    flex: 1;
    max-width: 260px;
}

/* Submit Button */
.submit-btn {
    font-family: 'Karla', sans-serif;
    font-size: 16px;
    padding: 12px 32px;
    background: #002FA7;
    color: #fff;
    border: none;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='7' fill='%23002FA7'/></svg>") 20 20, auto;
    transition: background 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
    background: #0024a0;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: #7a8fcc;
    cursor: not-allowed;
}

/* Form Message */
.form-message {
    margin-top: 16px;
    font-size: 14px;
}

.form-message.success {
    color: #2e7d32;
}

.form-message.error {
    color: #c62828;
}

/* Custom Validation Error Messages */
.validation-error {
    font-family: 'Karla', sans-serif;
    font-size: 13px;
    color: #c62828;
    margin-top: 6px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

.validation-error.show {
    opacity: 1;
    max-height: 30px;
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-bottom-color: #c62828;
}

.form-group input.invalid:focus,
.form-group textarea.invalid:focus {
    border-bottom-color: #c62828;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 48px 20px;
    }
    
    h1 {
        font-size: 2.6rem;
        margin-bottom: 36px;
    }
    
    body {
        font-size: 18px;
    }
    
    p {
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Keep paragraphs block-level for layout */
p {
    display: block;
}

.text-span {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    user-select: text;
    -webkit-user-select: text;
}

/* Neutralize default selection to prevent faint whitespace boxes */
*::selection {
    background: transparent;
    color: inherit;
}

/* Selection - only allow text to be visually selected */
h1::selection,
.text-span::selection,
label::selection,
span::selection,
input::selection,
textarea::selection,
.glitch-text::selection {
    background: #002FA7;
    color: #fff;
}
