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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

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

.form-container {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

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

/* Top section with logo */
.top {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.top img {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: transform 0.3s ease;
}

.top img:hover {
    transform: scale(1.1) rotate(5deg);
}

.top h2 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Form title */
form .title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: #2d5a3d;
    position: relative;
}

form .title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 2px;
}

/* Input controls */
.input-control {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    position: relative;
}

.input-control label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d5a3d;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-control label i {
    color: #28a745;
    font-size: 1rem;
}

.input-control input,
.input-control select {
    padding: 1rem 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #495057;
}

.input-control input:focus,
.input-control select:focus {
    border-color: #28a745;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    transform: translateY(-2px);
}

.input-control input:hover,
.input-control select:hover {
    border-color: #20c997;
    background: #ffffff;
}

/* Remove number input spinners */
.input-control input[type="number"]::-webkit-inner-spin-button,
.input-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-control input[type="number"] {
    -moz-appearance: textfield;
}

/* Error messages */
.input-control span {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-control span::before {
    content: '⚠';
    color: #dc3545;
}

/* Button styling */
form .button {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0 1.5rem 0;
}

.button button {
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

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

.button button:hover::before {
    left: 100%;
}

.button button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.button button:active {
    transform: translateY(-1px);
}

.button button:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Eye icon for password */
#eye {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 3;
}

#eye:hover {
    color: #28a745;
}

/* Remember me and forgot password */
.check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.check .rem {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.check .rem:hover {
    color: #28a745;
}

.check .rem input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #28a745;
    cursor: pointer;
}

/* Login/Register links */
.login-register {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #6c757d;
}

a {
    text-decoration: none;
    color: #28a745;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: #20c997;
    transform: translateY(-1px);
}

/* Success states */
.input-control.success input {
    border-color: #28a745;
    background: #f8fff8;
}

.input-control.error input {
    border-color: #dc3545;
    background: #fff5f5;
}

/* Loading state for button */
.button button.loading {
    position: relative;
    color: transparent;
}

.button button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .form-container {
        max-width: 100%;
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .top img {
        width: 50px;
        height: 50px;
    }
    
    .top h2 {
        font-size: 1.2rem;
    }
    
    form .title h2 {
        font-size: 1.5rem;
    }
    
    .input-control input,
    .input-control select {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
    
    .button button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .top {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .top img {
        margin-right: 0;
    }
    
    form .title h2 {
        font-size: 1.3rem;
    }
    
    .input-control {
        margin-bottom: 1.2rem;
    }
    
    .input-control label {
        font-size: 0.85rem;
    }
    
    .input-control input,
    .input-control select {
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    
    .button button {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        border-radius: 15px;
    }
    
    .check {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 360px) {
    .form-container {
        padding: 1.2rem 0.8rem;
    }
    
    form .title h2 {
        font-size: 1.2rem;
    }
    
    .input-control input,
    .input-control select {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .button button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-container {
        border: 3px solid #000;
    }
    
    .input-control input,
    .input-control select {
        border: 2px solid #000;
    }
    
    .button button {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .button button {
        background: white;
        color: black;
        border: 1px solid #000;
    }
}
