/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Container */
.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

/* Login Wrapper */
.wrapper {
    background: white;
    max-width: 450px;
    width: 100%;
    border-radius: 25px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* Decorative gradient top border */
.wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #00bcd4 0%, #2196f3 25%, #ff4081 50%, #ffc107 75%, #ff5722 100%);
}

/* Title */
.wrapper .title {
    text-align: center;
    margin-bottom: 35px;
}

.wrapper .title span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.wrapper .title span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Form */
form {
    width: 100%;
}

/* Input Row */
.wrapper form .row {
    position: relative;
    height: 50px;
    margin-bottom: 20px;
}

.wrapper form .row i {
    position: absolute;
    width: 45px;
    height: 100%;
    color: #667eea;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    left: 0;
    top: 0;
    z-index: 1;
}

.wrapper form .row input[type="text"],
.wrapper form .row input[type="password"] {
    height: 100%;
    width: 100%;
    outline: none;
    padding-left: 50px;
    padding-right: 20px;
    border: 2px solid #e0e0e0;
    font-size: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
}

.wrapper form .row input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.wrapper form .row input::placeholder {
    color: #999;
    font-weight: 400;
}

/* reCAPTCHA Container */
.form-group {
    margin-bottom: 20px;
}

.g-recaptcha {
    transform: scale(0.95);
    transform-origin: 0 0;
    margin-bottom: 10px;
}

#captcha_error {
    display: block;
    font-size: 13px;
    margin-top: 8px;
    color: #dc3545;
    font-weight: 500;
}

/* Forgot Password Link */
.wrapper form .pass {
    text-align: right;
    margin: -10px 0 20px 0;
}

.wrapper form .pass a {
    color: #667eea;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wrapper form .pass a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Submit Button */
.wrapper form .row.button {
    margin-top: 25px;
    margin-bottom: 20px;
}

.wrapper form .row.button input[type="submit"] {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wrapper form .row.button input[type="submit"]:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.wrapper form .row.button input[type="submit"]:active:not(:disabled) {
    transform: translateY(-1px);
}

.wrapper form .row.button input[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Signup Link */
.wrapper .signup-link {
    text-align: center;
    font-size: 15px;
    color: #666;
}

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

.wrapper .signup-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Error Messages */
.text-danger {
    color: #dc3545;
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-top: 5px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* Tablets */
@media (max-width: 768px) {
    .container {
        padding: 30px 15px;
        min-height: calc(100vh - 150px);
    }
    
    .wrapper {
        max-width: 100%;
        padding: 35px 30px;
        border-radius: 20px;
    }
    
    .wrapper .title span {
        font-size: 26px;
    }
    
    .g-recaptcha {
        transform: scale(0.9);
    }
}

/* Mobile Landscape (576px - 767px) */
@media (max-width: 767px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .container {
        padding: 25px 12px;
    }
    
    .wrapper {
        padding: 30px 25px;
        border-radius: 18px;
    }
    
    .wrapper .title span {
        font-size: 24px;
    }
    
    .wrapper form .row {
        height: 48px;
        margin-bottom: 18px;
    }
    
    .wrapper form .row input[type="text"],
    .wrapper form .row input[type="password"] {
        font-size: 14px;
        padding-left: 45px;
    }
    
    .wrapper form .row i {
        width: 40px;
        font-size: 15px;
    }
    
    .wrapper form .row.button input[type="submit"] {
        height: 48px;
        font-size: 15px;
    }
    
    .g-recaptcha {
        transform: scale(0.85);
    }
}

/* Mobile Portrait (320px - 575px) */
@media (max-width: 575px) {
    .container {
        padding: 20px 10px;
        min-height: calc(100vh - 120px);
    }
    
    .wrapper {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .wrapper .title {
        margin-bottom: 25px;
    }
    
    .wrapper .title span {
        font-size: 22px;
        padding-bottom: 12px;
    }
    
    .wrapper .title span::after {
        width: 60px;
        height: 3px;
    }
    
    .wrapper form .row {
        height: 46px;
        margin-bottom: 16px;
    }
    
    .wrapper form .row input[type="text"],
    .wrapper form .row input[type="password"] {
        font-size: 14px;
        padding-left: 42px;
        padding-right: 15px;
        border-radius: 10px;
    }
    
    .wrapper form .row i {
        width: 38px;
        font-size: 14px;
    }
    
    .wrapper form .pass {
        margin: -8px 0 18px 0;
    }
    
    .wrapper form .pass a {
        font-size: 13px;
    }
    
    .wrapper form .row.button {
        margin-top: 20px;
        margin-bottom: 18px;
    }
    
    .wrapper form .row.button input[type="submit"] {
        height: 46px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .wrapper .signup-link {
        font-size: 14px;
    }
    
    .g-recaptcha {
        transform: scale(0.77);
        transform-origin: 0 0;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* Extra Small Mobile (320px - 374px) */
@media (max-width: 374px) {
    .wrapper {
        padding: 22px 18px;
    }
    
    .wrapper .title span {
        font-size: 20px;
    }
    
    .wrapper form .row {
        height: 44px;
    }
    
    .wrapper form .row input[type="text"],
    .wrapper form .row input[type="password"] {
        font-size: 13px;
    }
    
    .wrapper form .row.button input[type="submit"] {
        height: 44px;
        font-size: 13px;
    }
    
    .g-recaptcha {
        transform: scale(0.7);
    }
    
    .wrapper .signup-link {
        font-size: 13px;
    }
}

/* Loading State */
.wrapper form .row.button input[type="submit"].loading {
    position: relative;
    color: transparent;
}

.wrapper form .row.button input[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.8s linear infinite;
}

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

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Input Autofill Styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #f8f9fa inset;
    -webkit-text-fill-color: #333;
    transition: background-color 5000s ease-in-out 0s;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}