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

body {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 406;
    font-style: normal;
    font-variation-settings: "wdth" 82.3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Main Container */
.signup-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 500px; /* Reduced from 650px to 500px */
    height: auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

/* Left Section */
.left-section {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.brand-section {
    z-index: 2;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.brand-title {
    font-size: 2rem;
    font-weight: 700;
    color: white !important;
}

.brand-section .logo-container h1 {
    color: white !important;
}

.logo-container h1 {
    color: white !important;
}

.brand-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Image/Illustration Container */
.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.signup-illustration {
    position: relative;
    width: 180px;
    height: 180px;
}

.illustration-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.floating-elements {
    position: relative;
    width: 130px;
    height: 130px;
}

.element {
    position: absolute;
    font-size: 1.5rem;
    animation: float 4s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.element.doc {
    top: 15px;
    left: 15px;
    animation-delay: 0s;
}

.element.team {
    top: 15px;
    right: 15px;
    animation-delay: 1s;
}

.element.check {
    bottom: 15px;
    left: 15px;
    animation-delay: 2s;
}

.element.star {
    bottom: 15px;
    right: 15px;
    animation-delay: 3s;
}

/* Features List */
.features-list {
    z-index: 2;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    opacity: 0.95;
}

.feature-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider Line */
.divider-line {
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e1e5e9, transparent);
    opacity: 0.6;
}

/* Right Section */
.right-section {
    flex: 1;
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    min-height: 500px; /* Reduced to match container */
}

.form-container {
    width: 100%;
    max-width: 400px;
    /* Removed min-height to allow natural sizing */
}

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

.form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.5;
}

/* Form Styles */
.signup-form {
    width: 100%;
}

.form-group {
    margin-bottom: 12px; /* Reduced from 20px to 12px */
    min-height: 60px; /* Reduced from 80px to 60px */
}

/* Name fields side by side */
.name-group {
    margin-bottom: 12px;
    min-height: 60px;
}

.name-fields {
    display: flex;
    gap: 15px;
}

.name-field {
    flex: 1;
}

.name-field .form-label {
    display: block;
    font-weight: 500;
    color: white;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.name-field .input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.name-field .validation-message {
    margin-top: 4px;
}

/* Responsive design for name fields */
@media (max-width: 480px) {
    .name-fields {
        flex-direction: column;
        gap: 10px;
    }

    .name-field {
        flex: none;
    }
}

.form-label {
    display: block;
    font-weight: 500;
    color: white;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 11px;
    font-size: 1rem;
    z-index: 1;
    opacity: 0.7;
}

.form-input {
    width: 100%;
    padding: 11px 11px 11px 38px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
}

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

.form-input.valid {
    border-color: #10b981;
}

.form-input.invalid {
    border-color: #ef4444;
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.success {
    border-color: #10b981;
}

/* Phone Field with Country Selector */
.phone-container {
    position: relative;
    display: flex;
    align-items: stretch;
}

.country-selector {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    gap: 6px;
}

.country-selector:hover {
    background: rgba(255, 255, 255, 0.15);
}

.country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.country-code {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-arrow {
    color: white;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.country-selector.active .dropdown-arrow {
    transform: rotate(180deg);
}

.phone-input {
    border-radius: 0 8px 8px 0 !important;
    border-left: none !important;
    flex: 1;
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.country-option {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 10px;
}

.country-option:hover {
    background-color: #f8fafc;
}

.country-option img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.country-option span {
    color: #374151;
    font-size: 0.9rem;
}

.optional-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: normal;
}

/* Password Toggle */
.toggle-password {
    position: absolute;
    right: 11px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    color: white;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
    transform: scale(1.1);
}

.toggle-password .eye-icon {
    stroke: white;
    fill: none;
    width: 18px;
    height: 18px;
}

.toggle-password:hover {
    opacity: 1;
}

/* Password Strength */
.password-strength {
    margin-top: 4px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.very-weak {
    width: 20%;
    background: #ef4444;
}

.strength-fill.weak {
    width: 40%;
    background: #f59e0b;
}

.strength-fill.fair {
    width: 60%;
    background: #eab308;
}

.strength-fill.good {
    width: 80%;
    background: #3b82f6;
}

.strength-fill.strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 0.75rem;
    color: #666;
}

/* Validation Messages */
.validation-message {
    margin-top: 2px; /* Reduced from 4px */
    font-size: 0.75rem;
    min-height: 16px; /* Reduced from 18px */
    height: 16px; /* Fixed height to prevent layout shifts */
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.validation-message:empty {
    visibility: hidden; /* Keep space but hide empty messages */
}

.validation-message.success {
    color: #10b981;
    visibility: visible;
}

.validation-message.error {
    color: #ef4444;
    visibility: visible;
}

.validation-message::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 50%;
}

.validation-message.success::before {
    background: #10b981;
    content: '✓';
    color: white;
    font-size: 8px;
    text-align: center;
    line-height: 12px;
}

.validation-message.error::before {
    background: #ef4444;
    content: '!';
    color: white;
    font-size: 8px;
    text-align: center;
    line-height: 12px;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 12px; /* Reduced from 20px */
    min-height: 40px; /* Reduced from 50px */
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
}

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

.checkmark {
    width: 19px;
    height: 19px;
    border: 2px solid #e9e1e6;
    border-radius: 4px;
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #21ec06;
    border-color: #51f008;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-container input[type="checkbox"]:focus + .checkmark {
    border-color: #f01d01;
    box-shadow: 0 0 0 2px rgba(238, 20, 5, 0.2);
}

.checkbox-text {
    color: #374151;
}

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

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

/* Submit Button */
.submit-btn {
    width: 75%;
    margin: 0 auto 12px auto;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Social Buttons */
.social-divider {
    text-align: center;
    margin: 10px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb; /* subtle gray line visible on white */
}

.divider-text {
    background: transparent;
    padding: 0 15px;
    color: white;
    font-size: 0.875rem;
    position: relative;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.social-btn {
    max-width: 340px;
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.social-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.social-btn img {
    width: 18px;
    height: 18px;
}

/* Switch Form */
.switch-form {
    text-align: center;
    margin-top: 10px;
}

.switch-text {
    color: #666;
    font-size: 0.9rem;
}

.switch-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    font-size: larger;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    color: #374151;
    font-weight: 500;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.message-content {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.message-content.success {
    border-left-color: #10b981;
}

.message-content.error {
    border-left-color: #ef4444;
}

.message-icon {
    font-size: 1.25rem;
}

.message-text {
    flex: 1;
    color: #374151;
    font-weight: 500;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-close:hover {
    color: #333;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .signup-container {
        flex-direction: column;
        margin: 10px;
        min-height: calc(100vh - 20px);
    }
    
    .left-section {
        min-height: 200px;
        padding: 30px 20px;
    }
    
    .image-container {
        display: none;
    }
    
    .right-section {
        padding: 30px 20px;
    }
    
    .form-container {
        max-width: none;
    }
    
    .illustration-circle {
        width: 150px;
        height: 150px;
    }
    
    .floating-elements {
        width: 100px;
        height: 100px;
    }
    
    .element {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .social-buttons {
        flex-direction: column;
        margin-bottom: 16px;
    }
    
    .social-btn {
        width: 100%;
        max-width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        margin: 0;
    }
    
    .social-btn img {
        width: 20px;
        height: 20px;
    }
    
    .submit-btn {
        margin-bottom: 16px;
    }
    
    .switch-form {
        margin-top: 8px;
        padding: 0 5px;
    }
    
    .social-divider {
        margin: 16px 0;
    }
    
    .message-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Tablet responsive */
@media (max-width: 768px) {
    .social-btn {
        max-width: 100%;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .signup-container {
        margin: 0;
        border-radius: 10px;
        min-height: 450px; /* Reduced for mobile */
    }
    
    .left-section,
    .right-section {
        padding: 15px 12px; /* Reduced padding for better fit */
        min-height: auto; /* Allow natural height on mobile */
    }
    
    .form-container {
        min-height: auto; /* Allow natural height on mobile */
        padding: 0 5px; /* Add small inner padding */
    }
    
    .form-group {
        margin-bottom: 10px; /* Further reduced spacing on mobile */
        min-height: 50px; /* Smaller min-height for mobile */
    }
    
    .name-group {
        margin-bottom: 10px;
        min-height: 50px;
    }
    
    .checkbox-group {
        min-height: 35px;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .country-selector {
        min-width: 70px;
        padding: 0 8px;
    }
    
    .country-dropdown {
        max-height: 150px;
    }
    
    .country-option {
        padding: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .right-section {
        background: #1f2937;
    }
    
    .form-title {
        color: #f9fafb;
    }
    
    .form-subtitle {
        color: #9ca3af;
    }
    
    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-input:focus {
        border-color: #667eea;
    }
    
    .form-label {
        color: #e5e7eb;
    }
    
    .checkbox-text {
        color: #e5e7eb;
    }
    
    .switch-text {
        color: #9ca3af;
    }
    
    .validation-message {
        color: #9ca3af;
    }
}

/* Print styles */
@media print {
    .signup-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .left-section {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
}

/* Enhanced error display styles */
.error-suggestions {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

.error-suggestions p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #dc2626;
    font-size: 0.9rem;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.error-suggestions li {
    margin-bottom: 0.25rem;
    color: #7f1d1d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.field-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.field-error::before {
    content: "⚠️";
    margin-right: 0.5rem;
}

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