/* ===============================================
   ECOFERT GHANA - SIGNUP PAGE STYLING
   Modern Registration Design with Green, Yellow, White Theme
   =============================================== */

/* CSS Variables (inheriting from main.css) */
:root {
    /* Primary Colors */
    --primary-green: #2e7d32;
    --primary-green-dark: #1b5e20;
    --primary-green-light: #4caf50;
    --secondary-yellow: #ffeb3b;
    --secondary-yellow-dark: #f57f17;
    --secondary-yellow-light: #fff176;
    --pure-white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e8f5e8;
    
    /* Neutral Colors */
    --text-dark: #1a1a1a;
    --text-medium: #424242;
    --text-light: #666666;
    --border-light: #e0e0e0;
    
    /* Status Colors */
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    /* Gradients */
    --green-gradient: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    --yellow-gradient: linear-gradient(135deg, var(--secondary-yellow) 0%, var(--secondary-yellow-light) 100%);
    --signup-gradient: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 50%, var(--secondary-yellow) 100%);
    --card-gradient: linear-gradient(145deg, var(--pure-white) 0%, var(--light-gray) 100%);
    
    /* Shadows */
    --shadow-light: 0 2px 10px rgba(46, 125, 50, 0.1);
    --shadow-medium: 0 4px 20px rgba(46, 125, 50, 0.15);
    --shadow-heavy: 0 8px 30px rgba(46, 125, 50, 0.2);
    --shadow-card: 0 6px 25px rgba(46, 125, 50, 0.12);
    --shadow-hover: 0 12px 40px rgba(46, 125, 50, 0.25);
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ===============================================
   SIGNUP PAGE LAYOUT
   =============================================== */

body {
    background: var(--signup-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="signup-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23signup-grain)"/></svg>');
    opacity: 0.3;
    z-index: -1;
}

/* ===============================================
   MAIN CONTENT AREA
   =============================================== */

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 160px);
    position: relative;
    z-index: 2;
}

/* ===============================================
   AUTHENTICATION CONTAINER
   =============================================== */

.auth-container {
    background: var(--card-gradient);
    border-radius: 25px;
    box-shadow: var(--shadow-heavy);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: slideInUp 0.8s ease-out;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green-gradient);
}

/* ===============================================
   AUTH HEADER
   =============================================== */

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-header p {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin: 0;
    opacity: 0.8;
}

/* ===============================================
   AUTHENTICATION FORM
   =============================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ===============================================
   FORM ROW (for side-by-side inputs)
   =============================================== */

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.form-group {
    position: relative;
    flex: 1;
}

/* ===============================================
   FORM LABELS
   =============================================== */

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

/* ===============================================
   INPUT WRAPPER
   =============================================== */

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute; /* Keep position absolute here */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
    z-index: 2;
    transition: var(--transition-smooth);
}

.input-wrapper i:first-of-type { /* Target the lock icon */
    left: 1.25rem;
}

.input-wrapper input {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 3.5rem; /* Increased right padding for the eye icon */
    border: 2px solid var(--border-light);
    border-radius: 16px;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    background: var(--pure-white);
    color: var(--text-dark);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-light);
    min-height: 56px;
}

.input-wrapper input::placeholder {
    color: var(--text-light);
    font-size: 1rem;
    opacity: 0.8;
    font-weight: var(--font-weight-normal);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1), var(--shadow-medium);
    transform: translateY(-2px);
}

.input-wrapper input:focus + i {
    color: var(--primary-green);
    transform: translateY(-50%) scale(1.1);
}

.input-wrapper:hover input {
    border-color: var(--primary-green-light);
    box-shadow: var(--shadow-medium);
}

.input-wrapper:hover i {
    color: var(--primary-green-light);
}

.password-toggle {
    position: absolute;
    right: 1.25rem; /* Adjust as needed to align with right edge of input */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light); /* Inherit color from other icons */
    z-index: 3; /* Ensure it's above the input field */
    transition: var(--transition-smooth);
}

.password-toggle:hover {
    color: var(--primary-green); /* Change color on hover */
}



.input-wrapper input::placeholder {
    color: var(--text-light);
    font-weight: var(--font-weight-normal);
}

/* ===============================================
   PASSWORD STRENGTH INDICATOR
   =============================================== */

.password-strength {
    margin-top: 1rem;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.strength-meter {
    height: 100%;
    width: 0%;
    background: var(--error-color);
    border-radius: 2px;
    transition: var(--transition-smooth);
    position: relative;
}

.strength-meter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.strength-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
    padding: 0.5rem 0;
}

.strength-text span:last-child {
    font-weight: var(--font-weight-semibold);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: var(--light-gray);
    transition: var(--transition-smooth);
}

.strength-text .weak { color: var(--error-color); background: rgba(244, 67, 54, 0.1); }
.strength-text .fair { color: var(--warning-color); background: rgba(255, 152, 0, 0.1); }
.strength-text .good { color: var(--info-color); background: rgba(33, 150, 243, 0.1); }
.strength-text .strong { color: var(--success-color); background: rgba(76, 175, 80, 0.1); }

/* Password strength levels */
.strength-meter.weak {
    width: 25%;
    background: var(--error-color);
}

.strength-meter.fair {
    width: 50%;
    background: var(--warning-color);
}

.strength-meter.good {
    width: 75%;
    background: var(--info-color);
}

.strength-meter.strong {
    width: 100%;
    background: var(--success-color);
}

/* ===============================================
   PASSWORD REQUIREMENTS
   =============================================== */

.password-requirements {
    margin-top: 1rem;
    padding: 1.25rem;
    background: var(--light-gray);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

.password-requirements p {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    font-weight: var(--font-weight-medium);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    transition: var(--transition-smooth);
}

.requirement-item i {
    font-size: 0.5rem;
    margin-right: 0.5rem;
    color: var(--text-light);
    transition: var(--transition-smooth);
}

.requirement-item.valid {
    color: var(--success-color);
}

.requirement-item.valid i {
    color: var(--success-color);
}

.requirement-item.valid i::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* ===============================================
   PASSWORD MATCH INDICATOR
   =============================================== */

#password-match {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 10px;
    animation: slideInDown 0.3s ease-out;
}

#password-match p {
    color: var(--success-color);
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    font-weight: var(--font-weight-medium);
}

#password-match i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* ===============================================
   TERMS AND CONDITIONS
   =============================================== */

.terms-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-medium);
    transition: var(--transition-smooth);
    line-height: 1.5;
}

.terms-group:hover {
    color: var(--primary-green);
}

.terms-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
    cursor: pointer;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.terms-group span {
    user-select: none;
}

.terms-group a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: var(--transition-smooth);
}

.terms-group a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* ===============================================
   SUBMIT BUTTON
   =============================================== */

.btn-submit {
    background: var(--green-gradient);
    color: var(--pure-white);
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin-top: 0.5rem;
}

.btn-submit::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: var(--transition-smooth);
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    background: var(--primary-green-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

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

.btn-submit:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-light);
}

/* ===============================================
   DIVIDER
   =============================================== */

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.divider span {
    background: var(--card-gradient);
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ===============================================
   SOCIAL LOGIN
   =============================================== */

.social-login {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: 15px;
    background: var(--pure-white);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(46, 125, 50, 0.1), transparent);
    transition: var(--transition-smooth);
}

.btn-social:hover::before {
    left: 100%;
}

.btn-social:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-google {
    border-color: #db4437;
    color: #db4437;
}

.btn-google:hover {
    background: #db4437;
    color: var(--pure-white);
    border-color: #db4437;
}

.btn-social i {
    font-size: 1.2rem;
}

/* ===============================================
   AUTH FOOTER
   =============================================== */

.auth-footer {
    text-align: center;
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.auth-footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: var(--transition-smooth);
}

.auth-footer a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* ===============================================
   MESSAGES (ERROR/SUCCESS)
   =============================================== */

.error-message,
.success-message {
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInDown 0.5s ease-out;
    box-shadow: var(--shadow-light);
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.error-message i,
.success-message i {
    font-size: 1rem;
}

/* ===============================================
   LOADING STATES
   =============================================== */

.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--pure-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* ===============================================
   FORM VALIDATION STATES
   =============================================== */

.form-group.error .input-wrapper input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-group.success .input-wrapper input {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group.error .input-wrapper i {
    color: var(--error-color);
}

.form-group.success .input-wrapper i {
    color: var(--success-color);
}

/* ===============================================
   ANIMATIONS
   =============================================== */

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

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

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

@media (max-width: 768px) {
    main {
        padding: 1rem;
        min-height: calc(100vh - 140px);
    }
    
    .auth-container {
        padding: 2rem 1.5rem;
        max-width: 100%;
        margin: 0 10px;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .input-wrapper input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }
    
    .password-requirements ul {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .btn-submit {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-social {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        margin-top: 70px;
    }
    
    main {
        padding: 0.5rem;
        min-height: calc(100vh - 110px);
    }
    
    .auth-container {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .form-group {
        gap: 1rem;
    }
    
    .input-wrapper input {
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }
    
    .input-wrapper i {
        left: 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn-submit {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-social {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-social i {
        font-size: 1rem;
    }
    
    .password-requirements {
        padding: 0.75rem;
    }
}

/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */

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

/* Focus styles for better accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--secondary-yellow);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #1b5e20;
        --secondary-yellow: #ffc107;
        --text-dark: #000000;
        --text-medium: #333333;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
    }
    
    .auth-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .btn-submit,
    .btn-social {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}

/* ===============================================
   SPECIAL EFFECTS
   =============================================== */

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

.input-wrapper:focus-within {
    transform: translateY(-1px);
}

.terms-group:hover input[type="checkbox"] {
    transform: scale(1.1);
}

/* Floating animation for the auth container */
.auth-container {
    animation: slideInUp 0.8s ease-out, float 6s ease-in-out infinite 1s;
}

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

/* Success animation */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.success-message {
    animation: slideInDown 0.5s ease-out, successPulse 1s ease-out 0.5s;
}

/* Requirement item animation */
.requirement-item.valid {
    animation: checkmark 0.5s ease-out;
}

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

/* ===============================================
   DARK MODE SUPPORT (Optional)
   =============================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --pure-white: #1a1a1a;
        --off-white: #2d2d2d;
        --light-gray: #3a3a3a;
        --text-dark: #ffffff;
        --text-medium: #e0e0e0;
        --text-light: #b0b0b0;
        --border-light: #4a4a4a;
        --card-gradient: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .auth-container {
        background: var(--card-gradient);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .input-wrapper input {
        background: var(--off-white);
        color: var(--text-dark);
        border-color: var(--border-light);
    }
    
    .btn-social {
        background: var(--off-white);
        color: var(--text-dark);
        border-color: var(--border-light);
    }
    
    .password-requirements {
        background: var(--off-white);
        border-color: var(--border-light);
    }
}
