/* Global Styles */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --secondary: #34a853;
    --secondary-dark: #2d9247;
    --accent: #fbbc05;
    --accent-dark: #e6a704;
    --dark: #202124;
    --light: #f8f9fa;
    --gray: #5f6368;
    --light-gray: #e9ecef;
    --error: #ea4335;
    --error-dark: #d33426;
    --success: #34a853;
    --light-blue: #f0f7ff;
    --light-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.portal-header {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-left: 10px;
    font-weight: 700;
}

.logo-icon {
    color: var(--primary);
    font-size: 2.2rem;
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: rotate(15deg);
}

.back-to-portal {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-to-portal:hover {
    color: var(--primary-dark);
    transform: translateX(-3px);
}

/* Registration Container */
.registration-container {
    display: flex;
    min-height: calc(100vh - 80px);
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.registration-card {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.registration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

.registration-header h2 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.registration-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--light-gray);
    z-index: 1;
}

.progress-bar {
    position: absolute;
    top: 15px;
    left: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    z-index: 2;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background: var(--primary);
}

.step.completed .step-circle {
    background: var(--secondary);
}

.step-label {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* Form Styles */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

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

/* Required and Optional Field Indicators */
.required {
    color: var(--error);
    font-weight: bold;
}

.optional-label {
    color: var(--gray);
    font-weight: normal;
    font-size: 0.9em;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.form-control.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235f6368' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Country Code Selector Styles */
.phone-input-wrapper {
    display: flex;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.country-code-selector {
    position: relative;
    min-width: 150px;
    border-right: 2px solid var(--light-gray);
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.phone-input-wrapper:focus-within .country-code-selector {
    background: white;
    border-right-color: var(--primary);
}

.country-code-select {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235f6368' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
    font-weight: 500;
}

.country-code-select:focus {
    outline: none;
    background-color: var(--light-blue);
}

.country-code-select option {
    padding: 12px 16px;
    font-size: 1rem;
    background: white;
    color: var(--dark);
}

.phone-number {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 1rem;
    background: transparent;
    color: var(--dark);
    transition: all 0.3s ease;
}

.phone-number:focus {
    outline: none;
    background-color: var(--light-blue);
}

.phone-number::placeholder {
    color: var(--gray);
    opacity: 0.7;
}

/* Error state for phone input */
.phone-input-wrapper.error {
    border-color: var(--error);
    background: rgba(234, 67, 53, 0.02);
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

.phone-input-wrapper.error .country-code-selector {
    border-right-color: var(--error);
    background: rgba(234, 67, 53, 0.05);
}

.phone-input-wrapper.error .country-code-select,
.phone-input-wrapper.error .phone-number {
    background: transparent;
}

/* Hover effects */
.phone-input-wrapper:not(.error):hover {
    border-color: var(--primary);
    background: white;
}

.phone-input-wrapper:not(.error):hover .country-code-selector {
    border-right-color: var(--primary);
    background: var(--light-blue);
}

/* Date Picker Styles */
.date-input-wrapper {
    position: relative;
}

.date-input-wrapper input[type="date"] {
    padding-right: 40px;
}

.date-format-hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
    font-style: italic;
}

/* Custom date input styling */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input[type="date"]::after {
    content: '📅';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Payment Details Sections */
.payment-details {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.payment-details.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(26, 115, 232, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    box-shadow: 0 4px 6px rgba(52, 168, 83, 0.2);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    box-shadow: 0 6px 12px rgba(52, 168, 83, 0.3);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.success-message.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.success-message h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

/* Emergency Contact */
.emergency-contact {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.emergency-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23ffffff" opacity="0.05"><polygon points="1000,100 1000,0 0,100"></polygon></svg>');
    background-size: cover;
}

.emergency-contact .content {
    position: relative;
    z-index: 1;
}

.emergency-contact h4 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.emergency-contact p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.emergency-contact .btn {
    background: white;
    color: var(--primary);
    border: 2px solid white;
}

.emergency-contact .btn:hover {
    background: transparent;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Form Validation */
.error-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-control.error {
    border-color: var(--error);
    background: rgba(234, 67, 53, 0.02);
}

.form-control.error + .error-message {
    display: block;
}

.phone-input-wrapper.error + .error-message {
    display: block;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Redirect Countdown */
.redirect-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
    color: var(--primary);
}

.redirect-countdown #countdown {
    font-weight: bold;
    color: var(--secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .registration-card {
        padding: 30px 25px;
        margin: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .step {
        flex: 1;
        min-width: 80px;
    }
    
    .registration-header h2 {
        font-size: 1.8rem;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-navigation .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile phone input styles */
    .phone-input-wrapper {
        flex-direction: column;
        border-radius: 10px;
    }
    
    .country-code-selector {
        min-width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--light-gray);
    }
    
    .country-code-select {
        padding: 12px 16px;
        background-position: right 16px center;
    }
    
    .phone-number {
        padding: 12px 16px;
    }
    
    .phone-input-wrapper:focus-within .country-code-selector {
        border-right: none;
        border-bottom-color: var(--primary);
    }
}

@media (max-width: 480px) {
    .registration-card {
        padding: 25px 20px;
    }
    
    .registration-header h2 {
        font-size: 1.6rem;
    }
    
    .country-code-selector {
        min-width: 100%;
    }
    
    .country-code-select {
        font-size: 0.95rem;
        padding: 10px 14px;
        padding-right: 35px;
    }
    
    .phone-number {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* Remove old date input group styles */
.date-input-group {
    display: none;
}

.date-select {
    display: none;
}

@media (max-width: 768px) {
    .date-input-group {
        display: none;
    }
    
    .redirect-countdown {
        flex-direction: column;
        text-align: center;
    }
}