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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Registration Container */
.register-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.register-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.header-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.register-header h1 {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

/* Message Boxes */
.message-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-message {
    background: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
}

.error-message {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.message-box strong {
    display: block;
    margin-bottom: 4px;
}

.success-login-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.success-login-link:hover {
    background: #059669;
}

/* Form Styles */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Prevent grid overflow */
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-hint {
    font-size: 13px;
    color: #666;
}

/* Turnstile Widget Container */
#registerTurnstile {
    display: flex;
    justify-content: center;
}

/* Submit Button */
.register-submit-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.register-submit-button:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.register-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Footer */
.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.form-footer p {
    color: #666;
    font-size: 14px;
}

.login-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .register-card {
        padding: 30px 20px;
    }

    .register-header h1 {
        font-size: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-input {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

@media (max-width: 380px) {
    .register-card {
        padding: 25px 16px;
    }

    .register-submit-button {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ========================================
   Terms of Service Checkbox
   ======================================== */
.terms-checkbox-group {
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #667eea;
}

.checkbox-container input:checked ~ .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

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

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

.checkbox-label {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.terms-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.terms-link:hover {
    color: #5568d3;
    text-decoration: underline;
}
