/* src/app/(auth)/styles.css */

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    position: relative;
    background: linear-gradient(135deg, #1A2980 0%, #26D0CE 100%);
    overflow: hidden;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #84ff6b, #24aeee);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    top: 50%;
    right: -125px;
    animation-delay: 2s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    bottom: -100px;
    left: 20%;
    animation-delay: 4s;
}

.orb-4 {
    width: 180px;
    height: 180px;
    background: linear-gradient(45deg, #54a0ff, #5f27cd);
    top: 20%;
    left: 70%;
    animation-delay: 1s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-30px) rotate(120deg);
    }

    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* Floating Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* Login Card */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: cardSlideIn 0.8s ease-out;
}

.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #f3f9fa, #eafcf9);
    background-size: 300% 300%;
    border-radius: 24px;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
    opacity: 0.7;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header */
.login-header {
    margin-bottom: 30px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 48px;
    background: linear-gradient(45deg, #1A2980 0%, #26D0CE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: rgb(59, 59, 59);
    margin-top: 8px;
    text-transform: uppercase;
    text-align: center;
}

@keyframes logoGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.5));
    }

    to {
        filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8));
    }
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    animation: titleFadeIn 1s ease-out 0.2s both;
}

.login-subtitle {
    color: #2c2c2c;
    font-size: 16px;
    margin-bottom: 0;
    animation: titleFadeIn 1s ease-out 0.4s both;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-container {
    position: relative;
    margin-bottom: 8px;
}

.custom-input {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.custom-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 1);
    outline: none;
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.custom-input:focus+.input-focus-border {
    width: 100%;
}

/* Ẩn hoàn toàn con mắt mặc định */
input[type="password"]::-ms-reveal {
    display: none;
    /* Hoặc visibility: hidden; */
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
}

/* Custom Checkbox */
.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: inline-block;
}

/* Dấu tích */
.custom-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    color: white;
    font-size: 12px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

/* Khi được chọn */
.custom-checkbox:checked {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: #667eea;
}

.form-check-label {
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
}


.forgot-link {
    color: #5e63b1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, #1A2980 0%, #26D0CE 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-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;
}

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

.login-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Tùy chỉnh màu sắc cho nút đóng sang màu đỏ nhạt */
.btn-close-danger {
    /* Thay đổi màu fill trong SVG của background-image thành màu bạn muốn */
    /* Màu #ff6b6b được encode thành %23ff6b6b */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ff6b6b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
    opacity: 1 !important;
    /* Đảm bảo không bị mờ nếu có opacity mặc định */
}

/* Thay đổi màu khi hover */
.btn-close-danger:hover {
    /* Thay đổi màu fill trong SVG của background-image thành màu hover bạn muốn */
    /* Màu #ee5a24 được encode thành %23ee5a24 */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ee5a24'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
}

/* Register Link */
.register-text {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.register-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.register-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Social Login */
.social-login {
    padding-top: 20px;
}

.divider {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 20px;
    color: #6c757d;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.google-btn {
    background: linear-gradient(45deg, #dd4b39, #ea4335);
}

.facebook-btn {
    background: linear-gradient(45deg, #3b5998, #4267b2);
}

.github-btn {
    background: linear-gradient(45deg, #333, #24292e);
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 2FA Modal */
.modal-2fa {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    animation: modalSlideIn 0.3s ease-out;
}

/* Forgot Password Modal */
.modal-forgot {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    animation: modalSlideIn 0.3s ease-out;
}

/* Success Modal */
.modal-success {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    animation: modalSlideIn 0.3s ease-out;
    border: 2px solid #10ac84;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 0;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.modal-body {
    padding: 20px 30px 30px;
}

.otp-icon {
    font-size: 48px;
    color: #667eea;
}

.forgot-icon {
    font-size: 48px;
    color: #ff6b6b;
}

.forgot-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.forgot-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.forgot-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-login-btn {
    background: transparent;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 24px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-login-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.otp-input {
    width: 50px;
    height: 60px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: scale(1.05);
}

.verify-btn {
    background: linear-gradient(45deg, #10ac84, #00d2d3);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.verify-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 172, 132, 0.4);
}

.verify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-btn {
    background: transparent;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 24px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.resend-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Success Modal Styles */
.success-icon {
    font-size: 80px;
    color: #10ac84;
    animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.success-message {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated Checkmark */
.success-animation {
    margin-top: 20px;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10ac84;
    stroke-miterlimit: 10;
    margin: 10px auto;
    box-shadow: inset 0px 0px 0px #10ac84;
    animation: fill 0.4s ease-in-out 0.9s forwards, scale 0.3s ease-in-out 0.9s both;
    position: relative;
}

.checkmark_stem {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 1.2s forwards;
}

.checkmark_kick {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 1.4s forwards;
}

.checkmark_stem,
.checkmark_kick {
    position: absolute;
    width: 26px;
    height: 5px;
    background-color: #10ac84;
    left: 50%;
    top: 50%;
}

.checkmark_stem {
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 2px;
}

.checkmark_kick {
    transform: translate(-50%, -50%) rotate(-45deg);
    border-radius: 2px;
    width: 13px;
    left: 40%;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #10ac84;
    }
}

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

    .login-title {
        font-size: 24px;
    }

    .logo-icon {
        font-size: 40px;
    }

    .otp-container {
        gap: 5px;
    }

    .otp-input {
        width: 45px;
        height: 55px;
        font-size: 20px;
    }

    .social-buttons {
        gap: 10px;
    }

    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 15px;
    }

    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 18px;
    }

    .modal-body {
        padding: 15px 20px 25px;
    }

    .modal-header {
        padding: 25px 20px 0;
    }
}

/* Loading Animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}

/* Focus visible improvements */
.custom-input:focus-visible,
.login-btn:focus-visible,
.social-btn:focus-visible,
.verify-btn:focus-visible,
.resend-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-card {
        background: white;
        border: 2px solid #000;
    }

    .custom-input {
        border-color: #000;
    }

    .login-btn {
        background: #000;
        color: white;
    }
}