﻿/* ===== REGISTER PAGE STYLES ===== */
.register-page {
    background: linear-gradient(135deg, var(--very-light-green) 0%, rgba(40, 167, 69, 0.05) 100%);
    min-height: calc(100vh - 160px);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

    .register-page::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="register-pattern" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="25" cy="10" r="0.4" fill="rgba(40,167,69,0.08)"/><circle cx="75" cy="6" r="0.3" fill="rgba(40,167,69,0.05)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23register-pattern)"/></svg>');
        opacity: 0.8;
        pointer-events: none;
    }

/* ===== REGISTER CARD ===== */
.register-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(40, 167, 69, 0.15), 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(40, 167, 69, 0.1);
    overflow: hidden;
    position: relative;
}

    .register-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    }

/* ===== REGISTER HEADER ===== */
.register-header {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: var(--white);
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

    .register-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="header-grain" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="15" cy="8" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23header-grain)"/></svg>');
        opacity: 0.3;
        pointer-events: none;
    }

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .header-icon i {
        font-size: 24px;
        color: var(--white);
    }

.header-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header-text p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

.header-decoration {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
}

.decoration-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: dotPulse 2s ease-in-out infinite;
}

.dot-1 {
    animation-delay: 0s;
}

.dot-2 {
    animation-delay: 0.3s;
}

.dot-3 {
    animation-delay: 0.6s;
}

/* ===== REGISTER BODY ===== */
.register-body {
    padding: 40px 30px;
}

/* ===== FORM PROGRESS ===== */
.form-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    border: 3px solid #e9ecef;
    position: relative;
}

.progress-step.active .step-circle {
    background: linear-gradient(45deg, var(--primary-green), var(--secondary-green));
    color: var(--white);
    border-color: var(--primary-green);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.progress-step.completed .step-circle {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    min-width: 100px;
    transition: var(--transition);
}

.progress-step.active .step-label {
    color: var(--primary-green);
}

.progress-line {
    width: 100px;
    height: 3px;
    background: #e9ecef;
    position: relative;
    transition: all 0.4s ease;
}

    .progress-line.completed {
        background: var(--primary-green);
    }

/* ===== FORM STEPS ===== */
.form-step {
    display: none;
    animation: fadeInUp 0.5s ease;
}

    .form-step.active {
        display: block;
    }

.step-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(40, 167, 69, 0.1);
}

    .step-header h4 {
        font-size: 20px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

        .step-header h4 i {
            color: var(--primary-green);
        }

    .step-header p {
        color: var(--text-muted);
        margin: 0;
        font-size: 14px;
    }

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

    .form-label i {
        color: var(--primary-green);
        width: 16px;
        text-align: center;
    }

.input-wrapper {
    position: relative;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 20px 14px 50px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--white);
    height: auto;
}

    .form-control:focus {
        border-color: var(--primary-green);
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
        background: var(--white);
        transform: translateY(-1px);
    }

    .form-control.is-invalid {
        border-color: var(--error);
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
    }

    .form-control.is-valid {
        border-color: var(--success);
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    }

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 2;
}

.form-control:focus + .input-icon {
    color: var(--primary-green);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

    .toggle-password:hover {
        color: var(--primary-green);
        background: rgba(40, 167, 69, 0.1);
    }

.field-error {
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

    .strength-fill.weak {
        width: 25%;
        background: var(--error);
    }

    .strength-fill.fair {
        width: 50%;
        background: var(--warning);
    }

    .strength-fill.good {
        width: 75%;
        background: var(--info);
    }

    .strength-fill.strong {
        width: 100%;
        background: var(--success);
    }

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== PASSWORD REQUIREMENTS ===== */
.password-requirements {
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

    .password-requirements h6 {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.requirements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    transition: var(--transition);
}

    .requirement-item i {
        font-size: 8px;
        color: #e9ecef;
        transition: var(--transition);
    }

    .requirement-item.met {
        color: var(--success);
    }

        .requirement-item.met i {
            color: var(--success);
        }

/* ===== ROLE SELECTION ===== */
.role-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.role-option {
    position: relative;
}

    .role-option input[type="radio"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.role-card {
    display: block;
    background: var(--white);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

    .role-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: transparent;
        transition: var(--transition);
    }

    .role-card:hover {
        border-color: rgba(40, 167, 69, 0.3);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
    }

.role-option input:checked + .role-card {
    border-color: var(--primary-green);
    background: rgba(40, 167, 69, 0.02);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.2);
}

    .role-option input:checked + .role-card::before {
        background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    }

.role-icon {
    width: 60px;
    height: 60px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: var(--transition);
}

.role-option input:checked + .role-card .role-icon {
    background: linear-gradient(45deg, var(--primary-green), var(--secondary-green));
    color: var(--white);
}

.role-icon i {
    font-size: 24px;
    color: var(--primary-green);
    transition: var(--transition);
}

.role-option input:checked + .role-card .role-icon i {
    color: var(--white);
}

.role-content h5 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.role-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.role-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

/* ===== FORM NAVIGATION ===== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(40, 167, 69, 0.1);
}

.btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: var(--white);
    border-color: var(--primary-green);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

    .btn-primary::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 ease;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green));
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
        color: var(--white);
        text-decoration: none;
    }

        .btn-primary:hover::before {
            left: 100%;
        }

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d058);
    color: var(--white);
    border-color: var(--success);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

    .btn-success:hover {
        background: linear-gradient(135deg, #1e7e34, var(--success));
        transform: translateY(-2px);
        color: var(--white);
        text-decoration: none;
    }

.btn-outline {
    background: var(--white);
    color: var(--text-muted);
    border-color: #dee2e6;
}

    .btn-outline:hover {
        background: var(--light-gray);
        color: var(--text-dark);
        border-color: #adb5bd;
        text-decoration: none;
        transform: translateY(-1px);
    }

/* ===== REGISTER FOOTER ===== */
.register-footer {
    background: rgba(40, 167, 69, 0.02);
    border-top: 1px solid rgba(40, 167, 69, 0.1);
    padding: 25px 30px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-prompt {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.login-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

    .login-link:hover {
        color: var(--primary-green-dark);
        text-decoration: none;
    }

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

    .security-note i {
        color: var(--success);
    }

/* ===== BENEFITS SECTION ===== */
.benefits-section {
    margin-top: 30px;
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(40, 167, 69, 0.1);
    box-shadow: var(--shadow-sm);
}

    .benefits-section h5 {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 20px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

        .benefits-section h5 i {
            color: var(--warning);
        }

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(40, 167, 69, 0.1);
    transition: var(--transition);
}

    .benefit-item:hover {
        background: rgba(40, 167, 69, 0.08);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
    }

.benefit-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--primary-green), var(--secondary-green));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .benefit-icon i {
        font-size: 16px;
        color: var(--white);
    }

.benefit-content h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.benefit-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== VALIDATION SUMMARY ===== */
.validation-summary {
    border-radius: 12px;
    border: 1px solid rgba(220, 53, 69, 0.2);
    background: rgba(220, 53, 69, 0.05);
    padding: 16px;
    margin-bottom: 25px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .register-page {
        padding: 20px 0;
    }

    .register-header,
    .register-body,
    .register-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .header-decoration {
        position: static;
        justify-content: center;
        margin-top: 20px;
    }

    .header-text h2 {
        font-size: 24px;
    }

    .form-progress {
        flex-direction: column;
        gap: 20px;
    }

    .progress-line {
        width: 3px;
        height: 30px;
        transform: rotate(90deg);
    }

    .form-navigation {
        flex-direction: column;
        gap: 16px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .role-selection {
        grid-template-columns: 1fr;
    }

    .footer-content {
        text-align: center;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .benefit-item {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .register-card {
        margin: 0 10px;
    }

    .register-header {
        padding: 30px 20px;
    }

    .register-body {
        padding: 30px 20px;
    }

    .header-text h2 {
        font-size: 22px;
    }

    .step-circle {
        width: 40px;
        height: 40px;
    }

    .step-label {
        font-size: 12px;
        min-width: 80px;
    }

    .form-control {
        padding: 12px 16px 12px 45px;
    }

    .input-icon {
        left: 14px;
    }

    .toggle-password {
        right: 14px;
    }

    .role-card {
        padding: 20px;
    }

    .role-icon {
        width: 50px;
        height: 50px;
    }

    .requirements-list {
        grid-template-columns: 1fr;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .register-card,
    .form-step,
    .btn,
    .role-card,
    .benefit-item {
        animation: none !important;
        transition: none !important;
    }

    .decoration-dot {
        animation: none !important;
    }
}

/* ===== FOCUS STATES ===== */
.btn:focus,
.role-card:focus,
.login-link:focus {
    outline: 3px solid rgba(40, 167, 69, 0.4);
    outline-offset: 2px;
}

.form-control:focus {
    outline: none;
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3);
}

.referral-code-wrapper {
    position: relative;
    margin-top: 10px;
    padding: 15px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background-color: rgba(247, 247, 252, 0.7);
    transition: all 0.3s ease;
}

    .referral-code-wrapper:hover {
        border-color: #007bff;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    }

.referral-info {
    margin-top: 8px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

    .referral-info i {
        margin-right: 5px;
        color: #007bff;
        font-size: 14px;
    }

.input-wrapper .fas.fa-ticket-alt {
    transform: rotate(-45deg);
}

/* Thêm hiệu ứng hào quang cho mã giới thiệu */
.referral-code-wrapper::before {
    content: "Ưu đãi";
    position: absolute;
    top: -10px;
    right: 15px;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    color: #fff;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Hiệu ứng khi focus vào input mã giới thiệu */
.referral-code-wrapper .input-wrapper input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}