body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    overflow: hidden; /* Prevent scrolling */
    position: fixed; /* Additional fix for iOS scrolling */
    width: 100%;
}
.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 70px; /* Space for the fixed social links bar */
    overflow-y: auto; /* Allow scrolling within container if needed */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}
form {
    background-color: #1e1e1e;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 24px;
}
p.subtitle {
    text-align: center;
    color: #b0b0b0; /* Softer white color */
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
input[type="email"] {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}
input[type="email"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px #4d90fe;
}
.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}
.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
}
.checkbox-group label {
    margin: 0 0 0 10px;
    font-weight: normal;
    line-height: 1.4;
}
button {
    background-color: #4d90fe;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #357ae8;
}
.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}
.social-links {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    background-color: #1e1e1e;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}
.social-links a {
    margin: 0 15px;
    color: #ffffff;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s;
    padding: 10px;
}
.social-links a:hover {
    color: #bbbbbb;
}
.success-message {
    display: none;
    text-align: center;
    color: #4BB543;
    margin-top: 20px;
}

/* Placeholder styling */
::placeholder {
    color: #888;
    opacity: 1; /* Firefox */
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: #888;
}
::-ms-input-placeholder { /* Microsoft Edge */
    color: #888;
}

/* Referral section (replaces form after submission) */
.referral-section {
    background-color: #1e1e1e;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}
.referral-info {
    margin-top: 25px;
}
.referral-info p {
    margin-bottom: 15px;
}

/* Previous signup section */
.previous-signup {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-sizing: border-box;
}
.previous-signup p {
    margin-bottom: 10px;
    color: #b0b0b0;
}
.referral-link-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    position: relative;
    background-color: #2a2a2a;
    border-radius: 4px;
    padding: 8px 12px;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-all;
}
.referral-text {
    color: #4d90fe;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
    word-break: break-all;
    flex: 1;
    text-align: center;
    overflow-wrap: break-word;
}
.copy-icon {
    color: #4d90fe;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
    padding: 4px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-icon:hover {
    color: #fff;
}
.copy-button {
    margin-top: 10px;
    background-color: #2a2a2a;
    color: #4d90fe;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 4px;
    width: auto;
    display: inline-block;
}
.copy-button:hover {
    background-color: #333;
}
.clear-cookie-btn {
    background-color: #444;
    color: #ddd;
    font-size: 14px;
    padding: 8px 15px;
    margin-top: 10px;
    width: auto;
    display: inline-block;
}
.clear-cookie-btn:hover {
    background-color: #555;
}
.copied-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    top: -25px;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s;
}
.copied-tooltip.show {
    opacity: 1;
}
.referral-label {
    color: #b0b0b0;
    margin-bottom: 5px;
    font-size: 14px;
}
.referral-benefits {
    text-align: left;
    margin: 15px auto;
    max-width: 100%;
    padding-left: 20px;
    box-sizing: border-box;
}
.referral-benefits li {
    color: #b0b0b0;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .form-container {
        padding: 15px;
    }
    
    form, .referral-section, .previous-signup {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    p.subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .referral-link-container {
        padding: 8px;
        flex-wrap: nowrap;
    }
    
    .referral-text {
        font-size: 13px;
    }
    
    .referral-benefits {
        padding-left: 15px;
    }
    
    .referral-benefits li {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .social-links a {
        margin: 0 10px;
        font-size: 20px;
    }
    
    .copy-button, .clear-cookie-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Fix for inputs being hidden behind keyboard on mobile */
    input:focus {
        position: relative;
        z-index: 1;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .form-container {
        padding: 10px;
    }
    
    form, .referral-section, .previous-signup {
        padding: 15px 12px;
    }
    
    .referral-text {
        font-size: 12px;
    }
    
    .copy-icon {
        font-size: 14px;
    }
    
    .social-links a {
        margin: 0 8px;
        font-size: 18px;
    }
}

/* Fix for iOS viewport height issues */
@supports (-webkit-touch-callout: none) {
    body, html {
        height: -webkit-fill-available;
    }
    .container {
        height: -webkit-fill-available;
    }
}

/* Hide form when showing previous signup */
.form-hidden {
    display: none !important;
}