@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Playfair+Display:wght@500&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-subtle: #eff6ff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    --bg: #ffffff;
    --bg-surface: #f8fafc;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
}

body {
    font-family: 'DM Sans', sans-serif;
    height: 100vh;
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ── Layout ── */
.register-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.register-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: var(--bg);
    padding: 2rem;
    position: relative;
    overflow-y: auto;
}

.img-card {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff; /* light neutral background around the logo, optional */
}

.img-card img {
    width: 85%;
    height: auto;
    max-width: 900px;
    object-fit: contain;
    display: block;
}

/* ── Back button ── */
.back-btn {
    position: absolute;
    top: 28px;
    left: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
    z-index: 10;
}

.back-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    transition: transform 0.15s;
}

.back-btn:hover {
    color: var(--text-primary);
    background: #fff;
    border-color: #cbd5e1;
    transform: translateX(-2px);
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

/* ── Register box ── */
.register-box {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.register-header {
    margin-bottom: 32px;
}

.register-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    font-size: 36px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.register-header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 8px;
    font-weight: 400;
    line-height: 1.5;
}

/* ── Form ── */
.form-group {
    margin-bottom: 18px;
}

.input {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input input {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px 6px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.input input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input input:focus + label,
.input input:valid + label {
    transform: translateY(-10px) scale(0.78);
    color: var(--accent);
    font-weight: 500;
}

.input label {
    position: absolute;
    left: 16px;
    top: 14px;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    pointer-events: none;
    transform-origin: left top;
    background: var(--bg);
    padding: 0 3px;
    transition: transform 0.18s ease, color 0.18s ease;
}

/* ── Error banner ── */
.error-banner {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--error);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-banner::before {
    content: '⚠';
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Login link ── */
.login-link {
    text-align: center;
    margin: 6px 0 24px;
}

.login-link p {
    color: var(--text-secondary);
    font-size: 13.5px;
}

.login-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.login-link a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ── Register button ── */
.register-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    padding: 13px 24px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.register-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.register-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    z-index: 5;
    pointer-events: auto;
}

.toggle-password:hover {
    opacity: 0.8;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Make room for the eye icon */
.input input[type="password"],
.input input[type="text"] {
    padding-right: 44px;
}

/* ── Password strength meter ── */
.strength-meter {
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.25s ease, background 0.25s ease;
}

.strength-bar.weak   { width: 33%;  background: var(--error); }
.strength-bar.medium { width: 66%;  background: #f59e0b; }
.strength-bar.strong { width: 100%; background: #16a34a; }

.strength-label {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.strength-label.weak   { color: var(--error); }
.strength-label.medium { color: #b45309; }
.strength-label.strong { color: #16a34a; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .img-card {
        display: none;
    }
    .register-card {
        padding: 1.5rem;
    }
    .register-box {
        max-width: 100%;
    }
}