:root {
    --primary: #0d6efd;
    --secondary: #6f42c1;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
}

* {
    box-sizing: border-box;
}

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

.auth-container {
    max-width: 450px;
    width: 100%;
    margin: 20px;
}

.auth-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease-out;
}

/* Mobile full width */
@media (max-width: 480px) {
    body {
        background: white !important;
        display: block;
        padding: 0;
    }

    .auth-container {
        max-width: 100% !important;
        margin: 0 !important;
        width: 100%;
    }

    .auth-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        min-height: 100vh;
    }
}

.auth-header {
    padding: 40px 30px 30px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}


@media (max-width: 480px) {
    .auth-header {
        padding: 40px 20px 30px;
        border-radius: 0;
    }
}

.logo {
    height: 60px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.auth-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.auth-body {
    padding: 40px 30px;
}

@media (max-width: 480px) {
    .auth-body {
        padding: 30px 20px;
    }
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
    font-size: 15px;
}

/* Input group design */
.input-group-custom {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--light);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-group-custom:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.input-group-custom .input-group-text {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 18px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.input-group-custom .form-control {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 0;
    font-size: 16px;
    color: var(--dark);
}

.input-group-custom .form-control:focus {
    outline: none;
    box-shadow: none;
}

/* Password toggle button */
.password-toggle-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Error state */
.input-group-custom.is-invalid {
    border-color: var(--danger) !important;
    background: rgba(220, 53, 69, 0.05);
}

.invalid-feedback {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: 13px;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    text-decoration: none;
}

.btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
    color: white;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.spinner-border {
    width: 20px;
    height: 20px;
}

/*.auth-footer {*/
/*    text-align: center;*/
/*    padding: 25px 30px;*/
/*    border-top: 1px solid #e9ecef;*/
/*    background: linear-gradient(135deg, var(--primary), var(--secondary));*/
/*    color: white;*/
/*    font-size: 14px;*/
/*}*/

/*.support-icons {*/
/*    display: flex;*/
/*    justify-content: center;*/
/*    gap: 25px;*/
/*    margin-top: 15px;*/
/*    flex-wrap: wrap;*/
/*}*/

/*.support-icon {*/
/*    display: inline-flex;*/
/*    align-items: center;*/
/*    gap: 8px;*/
/*    color: white;*/
/*    text-decoration: none;*/
/*    font-weight: 500;*/
/*    padding: 10px 18px;*/
/*    border-radius: 10px;*/
/*    transition: all 0.3s ease;*/
/*    !*background: rgba(255, 255, 255, 0.1);*!*/
/*    background: var(--primary);*/
/*    min-width: 140px;*/
/*    justify-content: center;*/
/*    white-space: nowrap;*/
/*}*/

/*.support-icon:hover {*/
/*    background: rgba(13, 110, 253, 0.2);*/
/*    transform: translateY(-2px);*/
/*    text-decoration: none;*/
/*    color: var(--primary);*/
/*}*/

/*.support-icon i {*/
/*    font-size: 16px;*/
/*}*/

/*@media (max-width: 360px) {*/
/*    .support-icons {*/
/*        gap: 15px;*/
/*        flex-direction: column;*/
/*        align-items: center;*/
/*    }*/

/*    .support-icon {*/
/*        width: 90%;*/
/*        min-width: auto;*/
/*    }*/
/*}*/

.auth-footer {
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 13px;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.help-text {
    font-weight: 500;
    font-size: 14px;
    opacity: 0.95;
}

.copyright {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

.support-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
}

.support-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    min-width: 0;
    max-width: 140px;
}

.support-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    color: white;
}

.support-icon i {
    font-size: 14px;
    flex-shrink: 0;
}

.icon-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

/* Mobile-specific optimizations */
@media (max-width: 480px) {
    .auth-footer {
        padding: 12px 15px;
        font-size: 12px;
    }

    .footer-content {
        gap: 10px;
    }

    .footer-text {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
        flex-wrap: wrap;
    }

    .help-text {
        font-size: 13px;
        flex: 1;
        min-width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .copyright {
        font-size: 11px;
        flex: 1;
        text-align: center;
    }

    .support-icons {
        gap: 8px;
    }

    .support-icon {
        padding: 7px 10px;
        gap: 5px;
        max-width: 120px;
    }

    .icon-text {
        font-size: 12px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .auth-footer {
        padding: 10px 12px;
    }

    .support-icon {
        padding: 6px 8px;
        max-width: 100px;
    }

    .icon-text {
        font-size: 11px;
    }
}
/*=================================================*/

.message {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.auth-tabs::-webkit-scrollbar {
    display: none;
}

.auth-tab {
    flex: 0 0 calc(50% - 5px);
    min-width: 0;
    padding: 14px 8px;
    text-align: center;
    background: var(--light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-tab.active {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.auth-tab:hover:not(.active) {
    background: #e9ecef;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Terms Notice */
.terms-notice {
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.5;
    margin: 20px 0;
    padding: 15px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.terms-notice a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-notice a:hover {
    text-decoration: underline;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Social Login Row - Keep original layout */
.social-login-row {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.btn-google {
    flex: 1;
    padding: 14px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 12px;
    color: #3c4043;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 15px;
}

.btn-google:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: #3c4043;
}

.btn-google i {
    color: #4285f4;
    font-size: 18px;
}

.btn-apple {
    flex: 1;
    padding: 14px;
    background: #000;
    border: 1px solid #000;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 15px;
}

.btn-apple:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
}

.btn-apple i {
    color: white;
    font-size: 18px;
}

.back-link {
    text-align: center;
    margin-top: 25px;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #6c757d;
}

.divider div:first-child,
.divider div:last-child {
    flex: 1;
    height: 1px;
    background: #e9ecef;
}

.divider div:nth-child(2) {
    padding: 0 15px;
    font-size: 14px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .auth-tabs {
        gap: 8px;
        padding-bottom: 2px;
    }

    .auth-tab {
        flex: 0 0 calc(50% - 4px);
        padding: 12px 6px;
        font-size: 13px;
    }

    .btn-primary {
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
    }

    .social-login {
        gap: 10px;
    }

    .btn-google,
    .btn-apple {
        padding: 12px;
        font-size: 14px;
    }

    .terms-notice {
        margin: 15px 0;
        padding: 12px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .auth-tab {
        font-size: 12px;
        padding: 10px 4px;
    }

    .auth-tab i {
        font-size: 14px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .auth-container {
        max-width: 400px;
        margin: 40px auto;
    }

    .auth-header {
        padding: 35px 25px 25px;
    }

    .auth-body {
        padding: 35px 25px;
    }
}

@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Responsive adjustments for social login */
@media (max-width: 576px) {
    .social-login-row {
        flex-direction: column;
        gap: 12px;
    }

    .btn-google, .btn-apple {
        width: 100%;
    }

    .btn-magic {
        padding: 14px 20px;
        font-size: 15px;
    }
}