/* HB Client Portal Login Styles */

:root {
    --primary: #00B4D8;
    --secondary: #232937;
    --base: #FFFFFF;
    --light: #F1F3F5;
    --mid: #C0C0C0;
    --dark: #121212;
    --accent: #90E0EF;
    --gradient-primary: linear-gradient(135deg, #00B4D8 0%, #90E0EF 100%);
    --gradient-dark: linear-gradient(135deg, #232937 0%, #121212 100%);
    --shadow-soft: 0 10px 40px rgba(0, 180, 216, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 180, 216, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--gradient-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 180, 216, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(144, 224, 239, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 180, 216, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Floating geometric shapes */
.geometric-shape {
    position: absolute;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

.shape-1 {
    top: 10%;
    left: 15%;
    width: 100px;
    height: 100px;
    background: var(--primary);
    transform: rotate(45deg);
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    top: 70%;
    right: 20%;
    width: 80px;
    height: 80px;
    background: var(--accent);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.shape-3 {
    bottom: 20%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: var(--primary);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: float 7s ease-in-out infinite;
}

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

/* Login Container */
.login-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 480px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

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

.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 180, 216, 0.3);
    border: 3px solid white;
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    animation: rotate 4s linear infinite;
}

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

.logo-container i {
    font-size: 2.5rem;
    color: white;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
}

.brand-header h1 {
    color: var(--secondary);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.brand-header p {
    color: var(--mid);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Magic Link Form */
.magic-link-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: var(--transition);
    background: var(--base);
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-input:disabled {
    background-color: rgba(241, 243, 245, 0.5);
    cursor: not-allowed;
}

.magic-link-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.3);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.magic-link-button::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;
}

.magic-link-button:hover::before {
    left: 100%;
}

.magic-link-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 180, 216, 0.4);
}

.magic-link-button:active {
    transform: translateY(0);
}

.magic-link-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.magic-link-button.loading {
    background: linear-gradient(135deg, #0095b8 0%, #7ac7d4 100%);
}

/* Status Messages */
.status-message {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
    display: none;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.status-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
}

.status-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.status-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-message.info {
    background: rgba(0, 180, 216, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 180, 216, 0.2);
}

/* Ensure messages are completely hidden by default */
#message,
#error {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

#message.show {
    display: block;
    opacity: 1;
    max-height: 200px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 12px;
}

#error.show {
    display: block;
    opacity: 1;
    max-height: 200px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 12px;
}

/* Loading Animation */
.loading-spinner {
    display: none !important;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.loading-spinner.show {
    display: inline-block !important;
}

.loading-spinner.active {
    display: inline-block !important;
}

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

/* Security Features */
.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mid);
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 180, 216, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 180, 216, 0.1);
}

.security-item i {
    color: var(--primary);
    font-size: 1rem;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--mid);
    font-size: 0.85rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
}

.footer-subtitle {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Link Verification Section */
.link-verification {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    z-index: 100;
    animation: slideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.verification-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.verification-icon-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.verification-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #00B4D8, #90E0EF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 180, 216, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

.verification-icon i {
    font-size: 3rem;
    color: white;
    animation: iconPulse 2s ease-in-out infinite;
}

.verification-pulse {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(0, 180, 216, 0.3);
    border-radius: 50%;
    animation: pulseRing 2s cubic-bezier(0.25, 0, 0, 1) infinite;
}

.verification-content {
    width: 100%;
}

.verification-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1a365d, #00B4D8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.verification-message {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.email-delivery-status {
    background: linear-gradient(135deg, #e6fffa, #b2f5ea);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.delivery-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.delivery-bar {
    height: 100%;
    background: linear-gradient(90deg, #00B4D8, #90E0EF);
    border-radius: 2px;
    width: 0%;
    animation: progressFill 3s ease-out forwards;
}

.delivery-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #065f46;
    font-weight: 500;
}

.delivery-text i {
    color: #00B4D8;
    animation: paperPlane 2s ease-in-out infinite;
}

.verification-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 180, 216, 0.1);
}

.detail-item i {
    font-size: 1.2rem;
    color: #00B4D8;
}

.detail-item span {
    font-size: 0.8rem;
    color: #4a5568;
    text-align: center;
    line-height: 1.4;
}

.verification-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.resend-link-btn,
.back-to-login-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.resend-link-btn {
    background: linear-gradient(135deg, #00B4D8, #90E0EF);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
}

.resend-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

.back-to-login-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 1px solid rgba(0, 180, 216, 0.2);
}

.back-to-login-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes paperPlane {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Mobile Responsive for Enhanced Verification */
@media (max-width: 768px) {
    .link-verification {
        padding: 2rem 1.5rem;
    }
    
    .verification-icon {
        width: 100px;
        height: 100px;
    }
    
    .verification-icon i {
        font-size: 2.5rem;
    }
    
    .verification-title {
        font-size: 1.5rem;
    }
    
    .verification-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .verification-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .resend-link-btn,
    .back-to-login-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .brand-header {
        margin-bottom: 2rem;
    }
    
    .form-input {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .magic-link-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .verification-icon {
        width: 80px;
        height: 80px;
    }
    
    .verification-icon i {
        font-size: 2rem;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem;
        max-width: 100%;
        margin: 0;
    }
    
    .brand-header h1 {
        font-size: 1.8rem;
    }
    
    .logo-container {
        width: 80px;
        height: 80px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .security-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .security-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}
