/**
 * HTH Login Form Styles
 * 
 * Main CSS file for the login form styling
 * Exact copy from modern-wordpress-login.php for consistent appearance
 */

/* CSS Variables for dynamic theming */
:root {
    --primary-purple: #6D1B72;
    --secondary-purple: #36136D;
    --accent-pink: #CF7088;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 10px 30px rgba(109, 27, 114, 0.1);
    --shadow-hover: 0 20px 40px rgba(109, 27, 114, 0.15);
}

/* Dynamic CSS Variables - These will be overridden by plugin options */
.hth-login-form {
    --primary-purple: #6D1B72;
    --secondary-purple: #36136D;
    --accent-pink: #CF7088;
}

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

/* Body Styles */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login Container */
.login-container {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
}

.login-container:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

/* Login Header */
.login-header {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(207, 112, 136, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
    }
}

/* Brand Logo */
.brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.brand-logo i {
    font-size: 2.5rem;
    color: var(--white);
}

.brand-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
}

/* Header Typography */
.login-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.login-header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Login Body */
.login-body {
    padding: 40px 30px;
}

/* Form Floating Labels */
.form-floating {
    margin-bottom: 20px;
}

.form-floating .form-control {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light-bg);
}

.form-floating .form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.2rem rgba(109, 27, 114, 0.25);
    background: var(--white);
}

.form-floating .form-control:focus + label,
.form-floating .form-control:not(:placeholder-shown) + label {
    color: var(--primary-purple);
    transform: scale(0.85) translateY(-1rem) translateX(0.15rem);
}

.form-floating label {
    color: var(--text-muted);
    font-weight: 500;
    padding: 16px 20px;
}

/* Input Groups */
.input-group-text {
    background: transparent;
    border: 2px solid var(--border-color);
    border-left: none;
    color: var(--text-muted);
    border-radius: 0 12px 12px 0;
}

.input-group .form-control {
    border-right: none;
    border-radius: 12px 0 0 12px;
}

.input-group .form-control:focus + .input-group-text {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

/* Form Checkboxes */
.form-check {
    margin: 20px 0;
}

.form-check-input:checked {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(109, 27, 114, 0.25);
}

.form-check-label {
    color: var(--text-dark);
    font-weight: 500;
}

/* Login Button */
.btn-login {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff !important;
    width: 100% !important;
    max-width: 100% !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
}

.btn-login::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-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(109, 27, 114, 0.3);
}

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

/* Ensure button text is always white */
.btn-login,
.btn-login:focus,
.btn-login:hover,
.btn-login:active {
    color: #ffffff !important;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding: 20px 30px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--secondary-purple);
}

/* Alert Messages */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: var(--white);
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: var(--white);
}

/* Password Toggle */
.password-toggle {
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-purple);
}

/* Floating Shapes Animation */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(207, 112, 136, 0.1);
    border-radius: 50%;
    animation: float-shape 8s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float-shape {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.7; 
    }
    50% { 
        transform: translateY(-30px) rotate(180deg); 
        opacity: 1; 
    }
}

/* Enhanced Loading Animation */
.spin {
    animation: spin 1s linear infinite !important;
    display: inline-block;
}

.btn-loading .bi-arrow-clockwise {
    animation: spin 1s linear infinite !important;
    display: inline-block;
}

@keyframes spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

/* Enhanced Loading States */
.btn-loading {
    display: none !important;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-loading.show {
    display: flex !important;
}

.btn-loading .bi-arrow-clockwise {
    font-size: 1.1em;
    color: currentColor;
}

/* Ensure button text is hidden during loading */
.btn-loading .btn-text {
    display: none !important;
}

/* Loading button state */
.btn-login:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

/* Already Logged In Message */
.hth-login-already-logged-in {
    text-align: center;
    padding: 40px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.hth-login-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.hth-login-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hth-login-actions .btn-primary {
    background: var(--primary-purple);
    color: var(--white);
    border: none;
}

.hth-login-actions .btn-primary:hover {
    background: var(--secondary-purple);
    transform: translateY(-2px);
}

.hth-login-actions .btn-outline-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.hth-login-actions .btn-outline-secondary:hover {
    background: var(--text-muted);
    color: var(--white);
    border-color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .login-header,
    .login-body {
        padding: 30px 20px;
    }
    
    .brand-logo {
        width: 60px;
        height: 60px;
    }
    
    .brand-logo i {
        font-size: 2rem;
    }
}
