:root {
    --primary-color: #133058;
    --secondary-color: #ff5733;
    --accent-color: #10b981;
    --text-color: #1f2937;
    --light-text: #ffffff;
    --bg-light: #f3f4f6;
    --gradient-primary: linear-gradient(135deg, #133058 0%, #1e4a77 100%);
    --gradient-secondary: linear-gradient(135deg, #ff5733 0%, #e64a19 100%);
}

.referral-hero {
    padding: 160px 20px 80px;
    background: var(--gradient-primary);
    color: var(--light-text);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.referral-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.hero-content-center {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.referral-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.referral-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.referral-form-section {
    padding: 60px 0 100px;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.form-wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    padding: 48px;
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid rgba(229, 231, 235, 1);
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    color: var(--primary-color);
    font-size: 2.25rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

textarea {
    padding-left: 16px;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(19, 48, 88, 0.05);
    outline: none;
}

.phone-input-container {
    display: flex;
    gap: 12px;
}

.country-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
}

.terms-group {
    margin: 32px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 0.95rem;
    padding-left: 35px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 6px;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.terms-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.submit-button {
    width: 100%;
    background: var(--gradient-secondary);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 20px rgba(255, 87, 51, 0.2);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 87, 51, 0.3);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 550px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.close-modal, .close-success-modal {
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-body {
    padding: 0;
    overflow: hidden;
}

.terms-scroll-container {
    padding: 32px;
    max-height: 400px;
    overflow-y: auto;
    color: #4b5563;
    line-height: 1.7;
}

.modal-footer {
    padding: 24px 32px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    border-radius: 0 0 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.accept-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 60px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.accept-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.success-modal-content {
    padding: 48px;
    text-align: center;
    max-width: 480px;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}

.referral-link-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    margin: 24px 0;
    border: 1.5px dashed #e2e8f0;
}

.referral-link-box label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    padding: 12px;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    flex: 1;
}

.input-group button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}

.instagram-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1.5px solid #e5e7eb;
    margin-top: 15px;
}

.instagram-btn:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.instagram-btn i {
    font-size: 1.2rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-badges {
    display: flex;
    gap: 20px;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .referral-hero h1 { font-size: 2.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-wrapper { padding: 32px 24px; }
}
