/* Google Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Colour variables - overridden per-org via inline <style> in PHP */
:root {
    --org-primary:       #667eea;
    --org-primary-dark:  #764ba2;
    --org-primary-rgb:   102, 126, 234;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--org-primary) 0%, var(--org-primary-dark) 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, var(--org-primary) 0%, var(--org-primary-dark) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-img {
    max-width: 180px;
    max-height: 80px;
    height: auto;
    width: auto;
    margin: 0 auto 20px;
    display: block;
    object-fit: contain;
}

.logo-placeholder {
    max-width: 180px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

/* Fallback if no logo */
.logo-placeholder.no-image {
    width: 120px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.form-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 15px;
}

.form-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--org-primary);
    box-shadow: 0 0 0 3px rgba(var(--org-primary-rgb), 0.1);
    outline: none;
}

select[multiple].form-control {
    min-height: 120px;
    padding: 8px;
}

select[multiple].form-control option {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.text-danger {
    color: #ef4444;
}

/* Repeater styling */
.kinabase-repeater {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.repeater-label {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    display: block;
}

.repeater-item {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    background: white;
    transition: all 0.2s;
}

.repeater-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.remove-repeater-item {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
    background: #fee2e2;
    border: none;
    color: #dc2626;
    transition: all 0.2s;
}

.remove-repeater-item:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.add-repeater-item {
    background: white;
    border: 1.5px dashed #d1d5db;
    color: #6b7280;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.add-repeater-item:hover {
    border-color: var(--org-primary);
    color: var(--org-primary);
    background: #f9fafb;
}

/* Submit button */
.btn-primary {
    background: linear-gradient(135deg, var(--org-primary) 0%, var(--org-primary-dark) 100%);
    border: none;
    color: white;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(var(--org-primary-rgb), 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--org-primary-rgb), 0.4);
    background: linear-gradient(135deg, var(--org-primary) 0%, var(--org-primary-dark) 100%);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@media (max-width: 576px) {
    body {
        padding: 20px 10px;
    }
    
    .form-header {
        padding: 30px 20px;
    }
    
    .form-header h1 {
        font-size: 24px;
    }
    
    .form-body {
        padding: 30px 20px;
    }
    
    .repeater-item {
        padding: 16px;
    }
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-img {
    max-width: 180px;
    max-height: 80px;
    height: auto;
    width: auto;
    margin: 0 auto 20px;
    display: block;
    object-fit: contain;
}

.logo-placeholder {
    max-width: 180px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

/* Fallback if no logo */
.logo-placeholder.no-image {
    width: 120px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.form-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 15px;
}

.form-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

select[multiple].form-control {
    min-height: 120px;
    padding: 8px;
}

select[multiple].form-control option {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.text-danger {
    color: #ef4444;
}

/* Repeater styling */
.kinabase-repeater {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.repeater-label {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    display: block;
}

.repeater-item {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    background: white;
    transition: all 0.2s;
}

.repeater-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.remove-repeater-item {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
    background: #fee2e2;
    border: none;
    color: #dc2626;
    transition: all 0.2s;
}

.remove-repeater-item:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.add-repeater-item {
    background: white;
    border: 1.5px dashed #d1d5db;
    color: #6b7280;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.add-repeater-item:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f9fafb;
}

/* Submit button */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@media (max-width: 576px) {
    body {
        padding: 20px 10px;
    }
    
    .form-header {
        padding: 30px 20px;
    }
    
    .form-header h1 {
        font-size: 24px;
    }
    
    .form-body {
        padding: 30px 20px;
    }
    
    .repeater-item {
        padding: 16px;
    }
}