/**
 * Hồng Trị Auth - Styles
 * Matches the design mockup with theme color variables
 */

/* Main Wrapper */
.htauth-wrapper {
    max-width: 800px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Google Login Button */
.htauth-google-section {
    margin-bottom: 30px;
}

.htauth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #ffffff;
    border: 2px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.htauth-google-btn:hover {
    background: #f8f9fa;
    border-color: var(--htauth-primary, #8B4545);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Form Container */
.htauth-form-container {
    background: #ffffff;
    border: 3px solid var(--htauth-primary, #8B4545);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(139, 69, 69, 0.15);
}

/* Tab Navigation */
.htauth-tabs {
    display: flex;
    background: var(--htauth-primary, #8B4545);
}

.htauth-tab-btn {
    flex: 1;
    padding: 18px 24px;
    background: var(--htauth-primary, #8B4545);
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.htauth-tab-btn.active {
    background: #ffffff;
    color: var(--htauth-primary, #8B4545);
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%);
}

.htauth-tab-btn:first-child.active {
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
}

.htauth-tab-btn:hover:not(.active) {
    background: var(--htauth-primary-hover, #9B5555);
}

/* Tab Content */
.htauth-tab-content {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.htauth-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Text */
.htauth-welcome-text {
    margin-bottom: 24px;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

.htauth-welcome-text strong {
    color: var(--htauth-primary, #8B4545);
    text-decoration: underline;
    font-weight: 600;
}

/* Form Fields */
.htauth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.htauth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.htauth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.htauth-field label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.htauth-field input[type="email"],
.htauth-field input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.htauth-field input:focus {
    outline: none;
    border-color: var(--htauth-primary, #8B4545);
    box-shadow: 0 0 0 3px var(--htauth-primary-light, rgba(139, 69, 69, 0.1));
}

/* Password Toggle */
.htauth-password-wrapper {
    position: relative;
}

.htauth-password-wrapper input {
    padding-right: 48px;
}

.htauth-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    color: var(--htauth-primary, #8B4545);
    transition: opacity 0.2s ease;
}

.htauth-toggle-password:hover {
    opacity: 0.7;
}

.htauth-toggle-password svg {
    fill: currentColor;
}

/* Options Row */
.htauth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.htauth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.htauth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--htauth-primary, #8B4545);
}

.htauth-forgot-link {
    font-size: 14px;
    color: var(--htauth-primary, #8B4545);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.htauth-forgot-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Messages */
.htauth-message {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.htauth-message.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.htauth-message.success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.htauth-message.loading {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    color: #856404;
}

/* Submit Button */
.htauth-submit-btn {
    position: relative;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--htauth-primary, #8B4545) 0%, var(--htauth-primary-hover, #A05555) 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(139, 69, 69, 0.3);
}

.htauth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 69, 0.4);
}

.htauth-submit-btn:active {
    transform: translateY(0);
}

.htauth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.htauth-badge {
    position: absolute;
    top: -8px;
    left: 20px;
    background: #FFD700;
    color: var(--htauth-primary, #8B4545);
    font-size: 14px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: rotate(-5deg);
}

.htauth-btn-text {
    font-size: 18px;
    letter-spacing: 0.5px;
}

.htauth-btn-subtext {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.95;
}

/* Loading State */
.htauth-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.htauth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .htauth-wrapper {
        margin: 20px;
    }

    .htauth-tab-content {
        padding: 24px 20px;
    }

    .htauth-field-row {
        grid-template-columns: 1fr;
    }

    .htauth-tab-btn {
        font-size: 16px;
        padding: 16px;
    }

    .htauth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .htauth-google-btn {
        font-size: 14px;
        padding: 12px 16px;
    }

    .htauth-tab-btn {
        font-size: 14px;
        padding: 14px 12px;
    }

    .htauth-welcome-text {
        font-size: 14px;
    }
}